The Prophet (pbuh) said: “combat the self with hunger and thirst, for there is reward in that.”
One might perhaps ask: “wherefrom is this great virtue of hunger? What is the reason for it when there is but pain for the stomach and harmful suffering? And if it is to be so, then man should be granted greater rewards for allowing the self to suffer such harm in denying the flesh what it craves and forcing it to accept the objectionable and the like.”
Know ye that this (question) resembles the saying of the one who drinks medicine and benefits there from thinking that this benefit is due to the repugnance of medicine and its bitterness. So he proceeds to taste all that he hates. This is wrong. Benefit derives from the peculiar quality of medicine, not from its being bitter. Doctors attest this particular quality. Likewise, nobody speaks ill of the benefits of hunger but the brokers of the ulema.1Whoever suffers himself to endure hunger as an act of faith in keeping with the Shar’i`ah’s commendation thereof, he will benefit there from, even if he does not understand the effect of the benefit, in the same manner as he who drinks medicine benefits there from, even if he does not know the nature of the benefit.
The full text is available here.