To explain the heter of refuah on Chol HaMoed the poskim bring the halachah in Shulchan Aruch (536:3) that one is allowed to do refuah on an animal, even if it involves proper melachah. The source for this is the Tosefta (Moed Kotan 2:6). The Ritva (Moed Kotan 10b) explains that the heter is because it’s a דבר האבד – considered a loss not to treat it. The Keren Orah explains it’s because of tza’ar baalay chaim. The Meiri writes, that if they were lenient with animals, certainly they allowed refuah which involves melachah for people as well. The Nishmas Adam (Klal 110:2) also explains, that the heter to do melachah for a choleh, is because שאין לך דבר האבד גדול מזה – there is no bigger matter of loss than this.
However, the Pri Megodim (532, Eishel Avraham, s.k. 2) explains that the heter is because anything needed for refuah is considered צורך המועד – something needed for the Moed. There is a special heter to do melachah on Chol HaMoed, if it is needed for the Moed.
There is a big nafka minah [practical difference] between these two reasons, if the heter is because of דבר האבד , then even a ma’aseh uman [an act which requires a professional] is allowed, such as going to a professional dentist. If, however, the heter is because of צורך המועד, then we only allow a ma’aseh hedyat [non-professional], and not a ma’aseh uman
Practically, the poskim argue about when we can be lenient: The Igros Moshe (Orach Chaim 3:78) allows melachah when there is a little bit of pain, and some say one may do anything needed for refuah of a choleh on Chol HaMoed even if he has just a מיחוש בעלמא, or he wants to maintain his health (Shemiras Shabbos, Perek 66:20). The reason for the heter is that anything needed for one’s body is considered אוכל נ פש as is clear from the Biur Halachah (546:5 d.h. kol) in the name of the Ritva.
The Mishnah Berurah in Hilchos Succah (640:12) writes, on the halachah that if one lets blood, he is obligated in succah: That even if one did it just to guard his health and doesn’t feel any illness, and is not in pain, he is still obligated in the mitzvah of succah. Presumably the bloodletting was done on Chol HaMoed, so we have a clear proof that the Mishnah Berurah holds, that anything done for health even if one is not ill and is not in pain is allowed.