I wouldn't say it's just for credentials. Having passionate and smart colleagues and professors does wonder for your own passion and determination. It's the same reason companies have much more innovation in offices compared to remote working.
The other thing is the networking, I have plenty of former colleagues that own their gig, and plenty others that are CEOs, CTO, COOs