I wish I knew in more detail why people do this but what I can recommend is to be aware of how the relationships changes.
I used to be best friends with someone since my first year in college. It’s now my fourth year and the relationship with him is not nearly the same. Our friendship flourished early because we had a healthy social life. We did things together and with other people. But throughout college our social lives deteriorated and hence our friendship. Some signs I noticed is I would do more things alone. I would spend more time studying,at school, and doing personal things at home. And I think he responded in his own way by doing the same. This time is very critical because both people tend to form negative opinions about the other. And it’s exacerbated by lower levels of communications than before.
Very recently, he started hanging out with our old friends and the amount of time he spends with them is comparable to the amount of time I spent with him.
Personally, it’s sad that it changed for the worse but I’m glad it happened because I grew apart from him.
In terms of relationships I can say if you’re noticing that things are changing between you two then your best bet is to share that observation with them and hopefully we two are mature enough to discuss possible solutions. Hopefully this helps. Goodluck!