Let's look at an overly simplified example of how the major players we've talked about work together to produce the music you hear on the radio, buy on CDs, or download (legally) from the Internet.
A songwriter writes the lyrics and melody for a song. The songwriter records that song in his basement and sends the tape to the Library of Congress to register the copyright. Even though he knows it is automatically copyrighted when he set it in a fixed form (put it on paper and/or recorded it), he is registering it because he's sure this song has the makings of a hit, and he wants to head off any infringement problems up front.
Now, although this songwriter has recorded his own vocal version of the song, he's humble enough to know that it probably won't go very far with his voice croaking it out. In walks the publisher. Our songwriter signs a single-song agreement with a publisher who will pitch the song to the record labels. Publishers are in the business of finding and exploiting new music by issuing mechanical licenses to recording companies or others who want to use the song in some fashion. In exchange for this "administration," the publisher gets 50% of the mechanical royalties for each recording sold (minus several things they have to pay for first, which we'll talk about in the next section).
Let's say that a major record label likes the song and has the perfect recording artist to sing it. They fill out a mechanical license agreement through the Harry Fox Agency and obtain rights to record the song. The song is recorded and is promoted heavily. It becomes a hit. Now, who is making money? The songwriter and publisher split mechanical royalties 50/50 for each recording sold, and the recording artist also gets a mechanical royalty for each recording sold (although that deal is set up differently).
In addition to the mechanical royalties, however, our songwriter and publisher are also paid performance royalties, which means they make money based on how often the song is played on the radio, in restaurants or bars, or in other types of broadcasts. These royalties are monitored, collected, and paid out by a performing rights organization like ASCAP, BMI, or SESAC; our artist is paid by the organization with which he registered the song. For subscription digital "performances," the recording artist now gets paid royalties as well.
Now, let's say that a movie producer is working on a new movie and wants to use the song in a scene. Now the song is moving into the realm of synchronization royalties (where music is used in conjunction with video). When a songwriter's work is synched with a scene in a movie, played over the credits at the end of a movie, or used in a television show or commercial, the songwriter and publisher are paid a negotiated fee to use the song in the movie as well as performance royalties when the movie is shown on TV or in theaters in foreign countries. If the movie uses the specific recording of your song (known as a "master") made by the artist who made the song famous, then that artist will receive a regular royalty percentage from the fee the movie company negotiates with the record company as well as mechanical royalties if there is a movie soundtrack produced. The songwriter and publisher will also receive mechanical royalties from sales of a soundtrack.
So as you can see, a lot of people are making money off of our songwriter's creative efforts.