The Taamei HaMinhagim says there is a custom to fast on Erev Rosh Chodesh because the moon became smaller. The Gemara in Chullin (60b) relates that originally, the sun and the moon were the same size. The moon asked Hashem how two kings could share one crown so Hashem told the moon to shrink itself. Hashem then tried to console the moon but it didn’t work. He therefore said that Klal Yisrael should bring a kapara for Him having made the moon smaller.
The moon is at its smallest the day before it begins getting larger on Rosh Chodesh, so this may be why the custom is to fast on Erev Rosh Chodesh, as part of the kapara.
When Rosh Chodesh is Sunday, like this month, we read the special haftorah of Machar Chodesh which took place on erev Rosh Chodesh and Rosh Chodesh, and discusses the love of Yehonason (crown prince and son of King Saul) and Dovid (King Saul’s son-in-law and the future and eternal King of the Jews,), how Yehonason saved his life, and promised that their children would forever be at peace. Perhaps we do this because they were in a similar situation. Two kings were vying for the same crown.
When Yehonason voluntarily made himself smaller so Dovid could rule, he effected an atonement of sorts for the moon and we remember this.
Unlike the moon which felt bad when it was ordered to be made smaller, Yehonason was happy to sacrifice his own honor for the honor of his beloved friend and did it of his own accord. When we think of others rather than ourselves, we are expressing the true royal nature of our people.
