The trouble with life is, by the time you understand it, it's over. That having been said -- thus establishing that I'm not an expert (hardly qualifying as a novice) -- I'll offer this:
There are those that stay together because it's so much more convenient. You own property together, your retirement money is bound together, your friends you've had for 40 years are as a couple -- the loss to your life would be so great if you split up, it simply couldn't be worth it.
But there are those that are genuinely happy together after decades. I think it's this group you're asking about.
I think it's luck. I don't have much to back that up, so it's only offered as an opinion. Two people get together when they're 20, then they both change into someone else when they're 25. And again at 30, and again, and again. For many if not most, this growth pushes them apart. Maybe not so much so that it warrants going their separate ways, but it's evident (to them) that things have changed for the worse.
But in some rare cases, the partners grow in roughly the same direction. It would seem inevitable that at least some of the time this would happen. If they each experience 10 life-changes, and all of these leave them compatible, then they wind up at the end as a happy, fulfilled couple.
I'm happy for them, but I wouldn't want to wager my life's happiness on getting that lucky myself.
Dave