Concise Bible Dictionary:
The first fasting we read of is when Moses went up into the mount to receive the tables of the covenant, and was there apart from nature with the Lord for forty days and nights (Deut. 10:10). The first national fasting was when Israel was smitten before Benjamin: they "came unto the house of God, and wept, and sat there before the Lord, and fasted that day until even, and offered burnt offerings and peace offerings before the Lord" (Judg. 20:26). Here, as in other places, it is connected with humbling; but in the case of Elijah, as with Moses, it signifies being apart from the ordinary life of flesh, to be with the Lord (1 Kings 19:8). Jehoshaphat, when the children of Moab and of Ammon came against him, proclaimed a fast throughout all Judah, and asked help of the Lord (2 Chron. 20:3). When Nineveh was threatened with destruction the king humbled himself, proclaimed a fast, and put on sackcloth: every one was to cry mightily to God, and put away his evil (Jonah 3:5). The only fast enjoined by the law was the one connected with the Day of Atonement. The word “fasting” does not occur there, but it is held to be included in the injunction “afflict your souls.” This seems to be confirmed by “the fast” mentioned in Acts 27:9, for the tenth of Tisri would answer to the time of the equinoctial gales, when it was dangerous to sail in the Mediterranean.
Later on we read of four fasts being kept (Zech. 7:5; Zech. 8:19), though we have no record of their having been instituted by God.
1. In the fourth month, corresponding to the “breaking up” of Jerusalem, when there was no bread for the people (Jer. 52:6).
2. In the fifth month, in memory of the destruction of the Temple (2 Kings 25:8, 9).
3. In the seventh month, in memory of the murder of Gedaliah (Jer. 41:1-2).
4. In the tenth month, in memory of the beginning of the siege of Jerusalem (Jer. 52:4). The prophet could say that these fasts should be turned into joy and gladness.
In the N.T. we find in John the Baptist the spirit of fasting, a Nazarite spirit of separation (Matt. 3:4). He also taught his disciples to fast. The Lord said of His disciples that when He was taken away, then they would fast; and while He was here He spoke of a certain power over unclean spirits that could only be exercised with prayer and fasting (Matt. 17:21). He Himself when led up of the Spirit into the wilderness to be tempted of the devil, fasted forty days and forty nights. It is a contrast to Moses and Elijah, they were apart from man's natural condition to be with God; and He who as man was ever with God was so apart to be in conflict with the devil.
Paul and Barnabas were sent on their first missionary journey after prayer and fasting (Acts 13:2-3). It is to be feared that because many have made fasting compulsory, and attached a superstitious merit to it, other Christians have altogether neglected the uniting of fasting with prayer. An habitual self-denial is doubtless the spirit of fasting rather than mere occasional abstinence from food.