They are mainly from proximity. You see people in class, you live near them, and you're near the same age. It's the same reason in person work would generate friendships/relationships. The challenge in today's remote world is proximity now has to be intentional.
Places of worship, community spaces like libraries/clubs - sure...but I had to develop these skills years before I moved to remote work.