Traditionally (until the late 1900s) musk did come from animals- although it was usually from deer (the musk deer). Other animals (and I think some plants) also produce the same sort of molecules that make that smell (including animals like cats). Unfortunately, getting the musk meant killing the musk deer (or other animal) to obtain the glands where the musk molecules are produced. Thankfully, chemists were able to figure out what kinds of molecule made the popular perfume smell and for over 100 years, we have been able to synthesise those molecules in a lab, saving a lot of animals lives!
So the smell is actually made in a lab, no cats harmed in the making of your perfume!
Most of the musks used today in the perfume or laundry industries are synthetic – in that they are made in a laboratory. This is primarily due to the fact that animals were hunted for this scent in the past and have now become endangered. Common musk type compounds are volatile and contain mostly hydrogen and carbon.