One is not allowed to do things for medicinal purposes on shabbos because the gemara says that chazal made a decree that it will lead to שחיקת סממנין which is the grinding of the medicines and a violation of טוחן. However, the gemara concludes that there is some machlokes tana'im. Rashi explains that the machlokes is whether chazal forbade types of refuah that don't involve medicine out of concern that it will lead to grinding medicines. Rashi seems to understand that the gezeira of שחיקת סממנין all agree applies to both people and animals, but R. Oshiya holds that it doesn't apply to refuah that doesn't involve medicine such as soaking in a pool of water. However, the Ritva says that the nature of the machlokes is whether we make the gezeira only by people because they will do whatever necessary to heal themselves and will come to grinding, but not by animals since one doesn't get so nervous about his animals health. Being that we pasken like Rav Oshiya, there is a very practical distinction between Rashi and the Ritva whether we permit refuah for animals even using medicines, or whether we permit refuah for people when it doesn't involve medicine. The opinion of the Ritva is also that of the Rif and the Rosh which the M.B. 332:5 paskens - we forbid all methods of healing for people but not for animals - ברפואת בהמתו אין אדם בהול כל כך שיבא לשחוק סממנים.
There is also a discussion regarding the nature of the gezeira that by permitting medicine one will come to grinding. The Eglei Tal (Tochen 37:7) writes that there are 3 approaches to this. 1. The Rif understands very simply that since one gets crazy over caring for their ailments and sicknesses, if we permit one to do forms of healing on shabbos they will be led to grind medicines. 2. Rashi seems to understand that if we permit refuah one will think that it is permitted to do tochen for the purpose of medicine. Meaning, rather than one accidentally coming to grind medicine because they are בהול about their refuah, they will think that the melacha of tochen is permitted. 3. The Eglei Tal offers an alternative approach to understanding this halacha. There are opinions in the Rishonim (teshuvas harashba and Ran) that Tochen follows the same rules as borer, so that if it is done immediately prior to the meal, it is permitted. The Rama 321:12 rules like this lenient opinion. Based on this the Eglei Tal explains that if we permit one to do things for refuah, they will come to equate refuah purposes with eating purposes and permit the act of grinding for refuah if it is done immediately prior to consumption. Therefore, chazal forbade refuah altogether in order to prevent people from equating refuah with eating purposes.