I think you have an inherent bias in your examples. There are bike riders outside of cities.
If you mean rural travel between small cities/towns, that's what I head in mind too with the first example (as that's the setting I grew up in).
If you mean sport biking (race, mountainbike, long distance), then you are right that I didn't consider those.
Anecdotally it's most strongly driven by "competition" with cars:
- Small city -> Not that much traffic -> No helments
- Big city with lacking bike infrastructure/no strong biking culture -> A lot of close encounters with cars -> Helmets
- Big city with established biking culture -> No helmets