This phenomenon is called "bus bunching". My friends, two profs from Georgia Tech and UChicago, came up with one solution for it. They wrote a paper about their solution[1], and then built a startup that has successfully implemented it at a bunch of places[2].
[1]: [A self-coördinating bus route to resist bus bunching](https://doi.org/10.1016%2Fj.trb.2011.11.001)
[2]: [NAU’s new bus system makes for shorter wait times for riders](https://news.nau.edu/nau-bus-schedules/)