Overall meaning :
Allah reminds the Children of Israel of the time when He commanded their ancestors to enter Jerusalem, to eat of its abundant food wherever they wished to their hearts’ content, and to submit to His will and enter it bowing down with humility and ask Him for forgiveness. He promised that once they did so, He would surely forgive their sins and give those who did good among them yet more out of His bounty.
However, the wrongdoers among them changed the words they were commanded to say, and so Allah sent down upon them a punishment from the heavens because of their disobedience.
He further asks then to recall the time when Moses prayed to Allah for water from which the Children of Israel would drink, and so Allah commanded him to strike the rock with his staff. Thereupon twelve springs gushed from the rock according to the number of the tribes, and each tribe knew its respective drinking-place. ‘Eat and drink of what Allah has provided for you,’ He instructed them, ‘and do not persistently spread corruption in the land.’
Then Allah Almighty reminds them of the time when they told Moses that they could no longer put up with one kind of food, namely manna and quails, and asked him to pray to Allah to bring forth for them some of what the earth produces of green herbs, cucumber, garlic, lentils and onions. He disapprovingly asked them why on earth they would exchange good food for inferior food and ordered them to go to any town and they would certainly find what they desired.
Ignominy and humiliation were decreed on them, and they incurred Allah’s wrath for persisting in denying the signs of Allah and killing His prophets unjustly. They suffered such punishment because they continuously disobeyed Allah and violated His limits.