Theorists try to find the standard: what is the template for a sonata? How is a fugal answer constructed? What is the model for a minuet? How does so-and-so organize his pitches? The fundamental problem with this is that it never captures the great works of music which are always unique. Though it is a pretty essential procedure for getting acquainted with the basics of how music can be put together.
Composers take a different approach. A lot of the time a composer is looking for something unique and special so that he can file the serial numbers off and steal it for use in one of his own pieces. No, really! As Stravinsky said, "composers don't borrow, they steal."
Beethoven kept going back to a string quartet in A major by Mozart for ideas. Bach re-wrote several concertos by Vivaldi. John Lennon stole some lyrics from an old Chuck Berry song ("Here come a flattop, he was movin' up with me"):
Filed off the serial numbers and turned it into this song:
By "filed off the serial numbers" I mean that he completely re-conceived the song and just echoed slightly one line in his lyrics, the opening, "Here come ol' flattop, he come groovin' up slowly". Pretty normal procedure for a composer. Of course in our over-lawyered times, it results in a lawsuit.