How concerts, classes, and community gatherings boost connection—and why some could leave us feeling lonelier.