Moses was one of the most rightous people but even he could not receive divine guidance for his people on full stomach. When the Lord had called Moses to the top of the mountain Sinai to hand over the Ten Commandments, he intended to destroy the people of Israel for making the golden calf in the absence of Moses. After Moses had gone through food and water abstention for forty days, he was able to ask the Lord to relent (Ex 32:9-14, Dt 9:9-10,18). Note that we can only live ca. 100 hours without drinking at an average environmental temperature. Clearly, Moses could go so far only in the presence of the Lord.
Queen Esther held a dry fast for three days and three nights and so did all the Jews (Esther 4:15-16). Then she tried to approach the king, which was strictly forbidden, for the sole purpose of saving the Jewish race. Thankfully Esther was accepted and the Jews were saved.
Daniel ate neither flesh nor drank wine for three weeks (Daniel 10:2-3). Then, an angle of the Lord revealed Daniel a far-reaching prophecy for his people valid until the End Times
God intended to destroy the city of Niniveh. After the prople of Niniveh had fasted for some time, God did not destroy their city (Jonah 3:5-10). The exact time of fasting is, however, unknown in this case.
Jesus had gone into a 40-day fast until he was ready to withstand the temptations of Satan (Luke 4:1-2). If Jesus had not stood Satan's temptation at that time, all humanity would have been lost.
When the disciples of Jesus roamed around to cast out demons from suppressed people, they could not deliver a man from a dumb spirit (Mark 9:17-29). Jesus gave two hints: "O faithless generation, how long shall I be with you?" and a littler further down, "This kind [of demon] can come forth by nothing, but by prayer and fasting". Hence, fasting brings the necessary faith to deliver demonized people from stubborn spirits.
Fasting and prayer is the ultimate act of humility. And so it still happens to believers in Christ that illness disappears and demons vanish by supernatural power. For example, I suffered from demonic oppression causing me undescribable pain. Through fasting the Lord revealed me the dark areas in my life where I underperform. So, I had the chance to realize, confess and repent; and the Lord healed me. This process took several years. More testimonies are reported in [1] for sick believers who were healed supernaturally through fasting and prayer.
In short, "When you fast....do it in secret...God will reward you in public". By the way, Jesus did not say "If you fast" implying that God expects us to fast at least occasionally.