- Peninei Halakha
When the prophets instituted the four fasts after the destruction of the First Temple, they modeled them after the fast of Yom Kippur. This is how the Sages usually enact decrees, modeling them after the Torah’s commandments. Just as Yom Kippur lasts an entire day, from evening to evening, so too, they instituted the four fasts as full-day fasts; just as there are five prohibitions on Yom Kippur – eating and drinking, bathing, anointing oneself, wearing leather shoes, and engaging in sexual relations – so too, they prohibited these things on the fasts over the destruction of the Temple. This is how the Jews observed these fasts throughout the seventy-year Babylonian exile.
When the exiles returned from Babylonia to build the Second Temple, these fasts were canceled and transformed into holidays, as it says:
Thus said the Lord of Hosts: The fast of the fourth month (in Tamuz), the fast of the fifth month (9 Av), the fast of the seventh month (Tzom Gedalia), and the fast of the tenth month (10 Tevet) shall become occasions for joy and gladness, happy festivals for the House of Judah; but you must love honesty and integrity. (Zechariah 8:19)
When the Second Temple was destroyed, however, the Jews reverted to observing these fasts, continuing to do so throughout the difficult years following the destruction of the Second Temple, during which Bar Kokhba’s rebellion and the destruction of Beitar and Judea took place. Thus, the status of these fasts depends on our national situation: At a time of evil decrees and persecution, we are obligated to fast, but when the Temple is standing, these fasts become days of joy and gladness.
In an intermediate situation – when, on the one hand, the Temple is ruined, but on the other hand, there are no harsh decrees against us, as was the case during R. Yehuda Ha-Nasi’s lifetime – the status of these fasts depends on the will of the Jewish people: “If they want, they fast; if they do not want, they do not fast.” This applies to Asara Be-Tevet, Shiva Asar Be-Tamuz, and Tzom Gedalia. Tisha Be-Av, however, does not depend on the nation’s will, and everyone is obligated to fast even in such an intermediate situation, because misfortune abounded and both Temples were destroyed on that day (rh 18b).
In practice, the Jewish people observe all the fasts, even in the intermediate situation, and therefore all Jews are obligated to fast on these days. This halakha applies until the Temple is rebuilt, speedily in our days, when the fast days will become days of joy and gladness.
 The Talmud states (rh 18b):
R. Papa said: “What [the verse] means is this: When there is peace, [these days] shall be for joy and gladness; when there are royal decrees, they shall be fast days; if there are no royal decrees but no peace, then if they want they fast, and if they don’t want, they don’t fast.” If that is the case, Tisha Be-Av also [should be optional]! R. Papa replied: “Tisha Be-Av is different because several misfortunes happened on it, as Mar said, ‘On Tisha Be-Av, the Temple was destroyed the first and second time, Beitar was captured, and the city [of Jerusalem] was plowed up.’”
According to Rashi, the definition of “when there is peace” – when the fasts are canceled – is when the nations of the world have no dominion over the Jews. If so, it is possible that Jews living in the State of Israel today are exempt from fasting. However, most Rishonim, including Ramban, Tur, and others, maintain that “when there is peace” means when the Temple is built. Therefore, even after the establishment of the State of Israel, we are in the intermediate situation and thus must fast in accordance with Jewish custom. The Rishonim also disagree about the nature of the “royal decrees” that render the fasts obligatory. Ramban maintains that it is when the Jewish people experience harsh decrees, while Rashi, Tur, and Tashbetz claim that it is specifically when there is religious persecution, meaning, decrees that prevent us from fulfilling the Torah’s commands. Their dispute stems from variant readings of the Talmud in rh 18b. (In the main text I wrote simply that the fasts became obligatory again after the destruction of the Second Temple. However, Ĥatam Sofer, oĥ 157 states that the Jews began fasting even before the destruction actually took place, once the Sanhedrin was exiled, as Yosippon attests. This shows that despite the existence of the Temple, the harshness of the decrees against the Jewish people is what determines the obligation to fast. Perhaps this supports Rashi’s opinion.)