They are not transforming the drug just the form. For example, elderly patients may have a hard time swallowing pills, for some medicines (not all) a compounding pharmacy can turn the pill into a lollipop. They can also turn things into like a cream or lotion.
/use to write code for a small independent pharmacy that had a couple compounding labs