Having your music used on TV commercials is a process called synchronisation or synch for short.
Historically the music used in TV commercials was requested by the client (the advertising company who represented the product) to music publishers, for the right to use the song, and record companies, for the right to use the recording. So you had to have a deal with either or both to have a chance of getting music on an ad.
This still happens in lots of cases, however nowadays there are many smaller digital companies that deal directly with advertising clients for writers and artists who do not have record or publishing contracts.
Checkout companies like Audionetwork or Sentric Music. Sentric in particular has a great blog with loads of good advice on the process and level of quality you need in terms of songs and recordings to have a chance.
There are many companies out there now that offer synch opportunities, I recommend signing up to the Unsigned Guide for a full listing.