Jesus is approached by the disciples of John the Baptist and asked why his disciples did not fast like they and the Pharisees did. Jesus then used this teaching to show that the New Covenant was a new teaching and fasting under the New Covenant was quite a different matter to the Old Covenant.
Fasting in the Old Covenant was a process employed for many reasons. There were four appointed fasts under the law of Moses that were strictly applied as well as a fifth fast that was less strictly applied. Typically fasting was a form of abstinence, usually from food or drink, for a period of time. Fasting was also not an end in itself, but was a purpose or means to an end. Often fasting was seen in the Old Testament as a mechanism for a person to draw near to God for a specific purpose. As an example we saw King David fast to come before God in the hope that God would heal his child and prevent his death. (2 Samuel 12:13-23) Esther also proclaimed a three day fast among the Jewish people to come before the Lord on her behalf before she went in to approach the King on behalf of the Jews. (Esther 4:10-17) There are other examples, but the key to these fasts, both individual and of the whole community, were that the fasts were targeted towards a specific purpose and to seek out God.
In addition to the appointed fasts, there was also a practice of personal fasting when an individual would abstain from food or some other pleasure so as to come before God. They would fast and bring their prayers to the Lord during the period of fasting. The practice of fasting twice a week arose and became a custom although there was no scriptural basis for this practice in either the Old or New Covenants.
Fasting in the New Covenant is only occasionally mentioned and does not appear to be a strict condition or requirement under the New Covenant, unlike the appointed fasts ordained in the law under the Old Covenant. A problem had arisen in the practice of fasting in the New Covenant period as Jesus mentioned this in several of his teachings. We see in Matthew 6:16-18 that some people would disfigure their faces and look dismal when they fasted so that people would see their situation and perhaps commend their abstinence or look upon them as being pious. Rather, Jesus counselled that they should clean themselves up when fasting so no-one knew of their fast so that when they brought their petition before God they would receive their commendation from Him and hopefully gain the answer to their prayers. We see Jesus also upbraided the Pharisees who saw themselves as better than other people for they fasted twice a week (Luke 18:9-14). But in this case the Pharisees were fasting as an end in itself. They fasted so that they could look good before others rather than trying to draw closer to God. Indeed the Pharisees on numerous occasions were upbraided by Jesus for doing the works of the law without applying the wisdom, justice, mercy and truth of the law. Their fasts were not to come closer to God but were done to look pious or religious in front of the people. It was a mark of their pride, arrogance and hypocrisy which Jesus disdained.
Now in this teaching back in Matthew 9:14-17 we see also that Jesus was showing that these were new teachings he was giving. Indeed he was teaching the New Covenant although at that time few would have been aware of this matter. And he showed that there was a challenge in giving this teaching for it involved a significant change. Humans as a species typically resist change because it requires effort and leads to the unknown. He gave two examples saying that you don’t put a new patch of unshrunk cloth into a garment that is already washed and old, and you don’t put new wine into old wineskins. In both cases if you do, more damage is done to both parts of the change. The wineskins are destroyed and the wine is lost and the patch shrinks and tears making a worse hole in the garment that was being repaired.
The old wineskins and the old garment in his examples are the people who have received the Old Covenant teachings. They are comfortable with the teachings and accepting of what they understand. The new wine and the new cloth patch represent the New Covenant teachings that Jesus was teaching the people. He was saying that to try and put these New Covenant teachings into the old people would be difficult and could even be damaging to them. The apostle Paul in his letters shows the anguish and heartache he went through in his walk as he had to reject the old Pharisee teachings he was steeped in from a young age, so that he could accept the New Covenant teaching he was receiving from Christ through the Holy Spirit. So it is possible to replace the old teachings, but Jesus was showing it would not be without difficulty and in some cases loss. In many cases it is better to leave the old people with their teachings and to seek new people to learn the new.
And so with fasting in the New Covenant, Jesus was saying that this is a new teaching too. Although it was mandated in the Old Covenant it is not as important in the New Covenant. The purpose of fasting in the Old Covenant was to come before God, but in the New Covenant we have direct access to God in Jesus Christ. Jesus himself said that he would be with us until the end of the age and we have access to him even today. The Holy Spirit he has given us has direct access to the Father to petition on our behalf, so we do not have the same need for fasting today as in former times.
The true fast that God sought from man was not an abstinence from food but rather to abstain from evil and to do good as shown in Isaiah 58:1-9. The fasts the Pharisees held were a sham but the true fast is consistent with the teachings that Jesus gave. There are times in the New Covenant where people did fast, however whether these are necessary now is questionable as we now have access to God through Jesus and the Holy Spirit directly. I would not suggest they either are or are not necessary and for the most part it is an individual matter. However they are not mandated in the New Covenant as they were under the Old Covenant.