Unlike the divinely appointed Day of Atonement (Yom Kippur), the fasts mentioned in this verse were of human origin. They were instituted to serve as reminders of four sorrowful events that befell the Jewish nation during the days of Jeremiah and Ezekiel.
The "fast of the fourth month," observed during the month of Tammuz, commemorated the time the city of Jerusalem was broken up (Jeremiah 52:6-7). The "fast of the fifth" was observed on the tenth of Ab, when the Temple and the houses were burned (verses 12-13). The "fast of the seventh" refers to the third of Tishri, when Gedaliah was slain by Ishmael (Jeremiah 40:8; 41:1-3, 15-18). The "fast of the tenth" was kept on the tenth of Tebeth, when the king of Babylon turned against Jerusalem (Ezekiel 24:1-2). This information can be verified in the Jewish Talmud.
As this verse shows, these humanly appointed fasts will be turned into feasts or occasions of gladness when God restores all Israel to His way of life. At last, the people will seek God (verses 20-23) and will be greatly blessed. They will no longer wish to perpetuate the memory of tragic events.
Holy Days: Atonement
Isaiah 58 and Fasting