The origins of Elul as a month of special Divine grace & mercy go back to the time of Moses, in the year 2448 from creation (1313 BCE) – the first year after the Jewish people went out of Egypt.
Seven weeks after the exodus, the people of Israel received the Torah at Mount Sinai & entered into an eternal covenant with God as His chosen people. But just 40 days later, while Moses was still up on the mountain, they violated their special relationship with God by worshipping a golden calf.
Upon descending from the mountain & witnessing their transgression, Moses smashed the two stone tablets on which God had inscribed the Ten Commandments; he then retuned to Mount Sinai for a second 40 days to plead with God on Israel’s behalf.
It was early on the 1st morning of the month of Elul that Moses once again ascended Mount Sinai, taking with him the stone tablets he had hewn, by divine command, for God to re-inscribe the Ten Commandments. On the mountain, God allowed Moses to “see My back, but not My face” (which Maimonides interprets as a perception of God’s reality but not His essence) — the closest any human being ever came to knowing God — & taught him the secret of His “Thirteen Attributes of Mercy” (Sh’mot 34:6-7).
Moses’ second journey to the top of the mountain lasted another 40 days, from the 1st of Elul until the 10th of Tishrei (Yom Kippur), during which time He obtained God’s wholehearted forgiveness & reconciliation with the people of Israel. Ever since, the month of Elul serves as the “month of Divine mercy & forgiveness.”
After God inscribes the new tablets with the commandments, He tells Moses to “put them in the ark” (Devarim 10:2). There is a midrash about what the word “them” is referring to. Does God want Moses to put the new tablets in the ark, or the old tablets, or both? According to the Midrash, God told Moses to put them both in the ark – the new tablets & the broken pieces of the first tablets that Moses smashed. Moses winced at this & said “but every time I see this mess I will remember how I lost my temper.” And God responded, “Exactly! If you remember & turn away from your mistakes (these are the steps of teshuvah), then even your mistakes can be holy!”
Related >>>> Preparing for High Holidays during Elul