I’m just going anecdotal here from college friends that have dispersed across the US.
Warm intros, so to speak, help. If you join a running group attended by a friend of a friend it seems to stick better than joining when you know absolutely no one.
Public transit helps. It’s hard to be consistent when going to the activity requires slogging through traffic.
And lastly, an activity that encourages repeated regular attendance. Hiking is an activity that is super flaky attendance compared to say training for a triathlon with a specific event day.