Israel broke the covenant with God by worshiping a golden calf idol.
Seemingly no sooner did GOD finish giving Moses the Law than Israel broke the covenant they had made with GOD just forty days earlier.
1 Now when the people saw that Moses delayed coming down from the mountain, the people gathered against Aaron and said to him, “Rise up and make us gods that shall go before us. As for Moses, the man who brought us up from the land of Egypt, we do not know what has become of him.” 2 Aaron then said to them, “Remove the golden earrings in the ears of your wives and daughters and bring them to me.” 3 So all the people removed the golden earrings in their ears and brought them to Aaron. 4 He received them from their hands; and he fashioned them with an engraving tool and made a molten calf. Then he said, “These are your gods, O Israel, that brought you out of the land of Egypt.” 5 So when Aaron saw it, he built an altar before it. Aaron then made a proclamation and said, “Tomorrow is a feast to the Lord.” 6 Thus he rose early the next day and offered whole burnt offerings and peace offerings; and the people sat down to eat and drink, and rose up to play.
7 But the Lord said to Moses, “Go quickly! Get down from here! For your people whom you brought out of the land of Egypt are transgressing the law. 8 They turned aside quickly from the way I commanded them. They made themselves a calf and are worshiping and sacrificing to it, and are saying, ‘These are your gods, O Israel, that brought you out of the land of Egypt.’ 9 Now therefore, let Me be, that I may burn in wrath against them and consume them. 10 Then I will make of you a great nation.” 11 But Moses prayed before the Lord God and said, “Why, O Lord, does Your wrath burn hot against Your people whom You brought out of the land of Egypt with great power and a mighty hand? 12 Why should the Egyptians speak and say, ‘He brought them out with evil intent, to kill them in the mountains and to consume them from the face of the earth’? Turn from Your fierce wrath and be merciful to the wickedness of Your people. 13 Remember Abraham, Isaac, and Jacob, Your servants, to whom You swore by Yourself and said to them, ‘I will greatly multiply your seed as the stars of heaven for multitude; and all this land I spoke about to give their seed, they shall inherit unto the ages.’” 14 So the Lord granted mercy for the harm He said He would do to His people.
15 Then Moses turned and went down from the mountain with the two tablets of the testimony in his hands. They were stone tablets written on both sides, on one side and on the other. 16 Now the tablets were the work of God, and the writing was the writing of God engraved on the tablets. 17 When Joshua therefore heard the noise of the people as they shouted, he said to Moses, “There is a noise of war in the camp.” 18 But Moses said, “It is not the noise of those that begin the battle, nor of those that begin the cry of defeat, but the noise of those that begin the banquet of wine that I hear.” 19 So it was, as soon as he came near the camp, he saw the calf and the dancing. Thus Moses became very angry; and he cast the two tablets out of his hands and broke them at the foot of the mountain. 20 Then he took the calf they had made, burned it in the fire, and ground it to powder; and he scattered it on the water and made the children of Israel drink it. 21 Moses then spoke to Aaron, “What did this people do to you that you brought so great a sin upon them?” 22 Aaron replied, “Do not be angry, my lord. You know how impulsive this people is. 23 For they said to me, ‘Make us gods that shall go before us; as for this man Moses, who brought us out of the land of Egypt, we do not know what has become of him.’ 24 So I said to them, ‘Whoever has any gold, let him remove it.’ Thus they gave it to me, and I cast it into the fire, and this calf came out.”
25 Now when Moses saw the people were scattered (for Aaron scattered them, making them a prey to their enemies), 26 Moses then stood in the entrance of the camp and said, “Whoever is on the Lord’s side, come to me.” So all the sons of Levi gathered themselves together to him. 27 He said to them, “Thus says the Lord God of Israel: ‘Let every man put his sword on his side and go in and out from entrance to entrance throughout the camp, and let every man kill his brother, every man his companion, and every man his neighbor.’” 28 So the sons of Levi did as Moses said to them, and about three thousand men of the people fell that day. 29 Then Moses said, “You filled your hands to the Lord today, each one on his son or brother, that blessing be given you.”
30 Now it came to pass on the next day that Moses said to the people, “You committed a great sin. So now I will go up to God to make atonement for your sin.” 31 Then Moses returned to the Lord and said, “I pray, O Lord, these people have committed a great sin and have made for themselves a god of gold! 32 Yet now, if You will forgive their sin, forgive it—but if not, blot me out of the book You have written.” 33 Then the Lord said to Moses, “Whoever sins against Me, I will blot him out of My book. 34 Now therefore, go down and lead the people to the place of which I spoke to you. Behold, My Angel shall go before your face. Nevertheless, in the day when I visit, I will strike them for their sin.” 35 So the Lord struck the people for making the calf which Aaron made.Exodus 32:1-35 OSB
To hold no other gods more precious than Jehovah GOD was the first commandment GOD gave to Israel, the first thing they heard GOD tell them audibly at Sinai.
This was immediately followed by the instruction to not make any graven image.
Israel broke both of these commands.
It is important that we realize that, in doing this, Israel violated the terms of the agreement (the covenant) that GOD had recently established with them. If GOD so chose, He would have been justified in immediately destroying these people, apart from Moses, because they broke the deal.
Throughout the Scriptures, time and again, Israel would break the covenant with GOD and, in His great mercy, GOD would reestablish the agreement with them after they repented. After a short period of time, Israel would repeat the evil cycle.
Moses, the Intercessor
When Israel was in grave danger of being destroyed, Moses stepped in on their behalf. This action is called interceding. Moses made an intercession on behalf of the guilty Israelites before the holy GOD.
Moses reminded GOD about the Egyptians and how destroying Israel would give them and the other nations reason to blaspheme GOD’s name, claiming GOD didn’t give Israel the promised land because He was incapable of doing so.
Moses asked GOD to extend mercy, reminding Him of His great relationship and affection with their forefathers, Abraham, Isaac, and Jacob.
Did these events surprise GOD? Does anything surprise GOD that He does not already foreknow? Of course not! Though GOD was angry in the moment, as we see Moses was once he beheld the idolatrous feasting, it seems clear that these events happened so that Moses could exercise compassion and they are recorded so that the reader can see that Moses served as a shadow of the Messiah, how Jesus intercedes on our behalf with GOD.