When the Jewish People sinned by worshipping the Golden Calf (Shemot 32:1-6) right after receiving the Torah from G-d, in effect rejecting His great gift, Moshe broke the first set of Holy Tablets, on which were inscribed the Ten Commandments.
Moshe then ascended Mount Sinai and pleaded with G-d for mercy and forgiveness on behalf of the Jewish people.
G-d accepted Moshe’s pleas and commanded him to make another set of two tablets like the first.
Moshe ascended the mountain again on Rosh Chodesh Elul (first day of the month of Elul) and remained there 40 days until the 10th of Tishrei.
On the 10th of Tishrei, better known as Yom Kippur, he brought down the second set of holy Tablets which was granted to the Jewish people as a sign of renewed Divine favor.
These 40 days were set for all future generations as days of repentance and forgiveness. These days are especially appropriate for personal reflection and repentance since they mark the perennial recurrence of Divine compassion.