Macca originally wanted to have “Junk” on the White Album but the other members didn’t want it. So he wound up putting it on his first solo album. IMHO, it’s one of the best melodies he ever came up with.
And they had so many of them. Some musicians are revered because they had maybe five hits or so in their careers. The Beatles must have had over 50 songs on the charts and numerous top ten hits. They had quality AND quantity.