Abba is the perfect example of a group that quit before they got too irrelevant, just as with The Beatles, they had a good seven-year run, and they didn’t overextend their welcome, which is why today they remain as big as they are.
In the Beatles’ case, they split in large part because they weren’t getting along anymore. Anything in their later catalog with a “Lennon & McCartney” songwriting credit is really more like Lennon OR McCartney.