I read somewhere long ago that the biggest factor in building friendships is shared experience - like the “circumstances” you described. More important than anything else. Ones those experiences go away so does the common ground.
I'm not saying this is always easy, and sometimes one or more people in the friend group just decide that the friendships aren't that important to them to maintain. But it's absolutely possible, and can be very rewarding.