I don't know how many songs Paul wrote but Telemann's (known) body of work consists of 3000 pieces of music.
But even without taking numbers into account. Bach always comes to mind. Even just one piece of music probably contain as much music as the entire Beatles discography. Not to mention that George Martin added a lot of music to some of their songs.
You take a fragment of even just a Concerto, something that's considered secondary in the context of that piece of music, an embellishment, a few notes from an harmony - and you can build a complete pop song out of that.
And, inversely, to Haydn or Mozart, a finished pop song would maybe represent, in the best of case, a basic idea, a starting point or a fragment of a much much larger piece.
If I'd put them on a scale, I'd say a pop song is like a little country on a tiny planet whereas the work of the great composers is usually more like an entire solar system.
That being said, I reiterate, I'm a huge fan of the Beatles and popular music.