Isreal had disobeyed God and turned to worhsipping idols, which had went against the first commandment of having no other gods before Jehovah God.
They made a choice. They had forgotten what God had done for them, and so quickly at that.
We, just like the children of Israel, forget sooooo fast what God has done for us at times. Maybe not meaning to, but we do tend to put other things and even people before God. It makes no difference what or who we put there, ANYTHING or ANYONE who takes us away from God and the time we spend with Him, is an idol. We must recognize that God has done so much for us, and we must not take that for granted. If we find ourselves in this position, we must ask for forgiveness as soon as possible.