This is the beginning of the story of the "cow," which is mentioned only in this surah and is well-known for being named after it, i.e., "Surah Al-Baqarah." There is a well-known historical disagreement among scholars of Quranic studies regarding the names of the surahs: some believe that the naming of the surahs is tawqifi (divinely ordained), meaning that it is part of the revelation and that the source of this knowledge is the Messenger of Allah ﷺ himself, while others believe that the source of the surah names is the ijtihad (independent reasoning) of the sahabah who compiled the Qur'an, with some names coming directly from the Messenger ﷺ as mentioned in the hadith and others being the result of their ijtihad.
As for the story of the cow—which distinguishes this surah and lends it its name—its events do not seem to have occurred during the desert wandering, but rather in the “town/misr” to which the Children of Israel descended to cultivate after they grew bored of eating manna and quails, and some of them violated the Sabbath. Therefore, the surrounding environment was an agricultural one where they arrogantly rejected Allah's command to sacrifice a cow and were reluctant to comply and submit, leading them to argue with their Prophet-Musa, peace be upon him.
They began their argument by accusing Musa, peace be upon him, of jesting and mocking them when he said that Allah commands them to sacrifice a cow. Musa sought refuge in Allah from being among the ignorant.
#Baqarah
And [recall] when Moses prayed for water for his people, so We said, "Strike with your staff the stone." And there gushed forth from it twelve springs, and every people [i.e., tribe] knew its watering place. "Eat and drink from the provision of Allāh, and do not commit abuse on the earth, spreading corruption." (60) Remember when you said, ‘Moses, we cannot bear to eat only one kind of food, so pray to your Lord to bring out for us some of the earth’s produce, its herbs and cucumbers, its garlic, lentils, and onions.’ He said, ‘Would you exchange better for worse? Go to Egypt and there you will find what you have asked for.’ They were struck with humiliation and wretchedness, and they incurred the wrath of God because they persistently rejected His messages and killed prophets contrary to all that is right. All this was because they disobeyed and were lawbreakers. (61) Indeed, those who believed and those who were Jews or Christians or Sabeans [before Prophet Muḥammad (ﷺ)] - those [among them] who believed in Allāh and the Last Day and did righteousness - will have their reward with their Lord, and no fear will there be concerning them, nor will they grieve. (62) And [recall] when We took your covenant, [O Children of Israel, to abide by the Torah] and We raised over you the mount, [saying], "Take what We have given you with determination and remember what is in it that perhaps you may become righteous." (63) Then you turned away after that. And if not for the favor of Allāh upon you and His mercy, you would have been among the losers. (64) And you had already known about those who transgressed among you concerning the sabbath, and We said to them, "Be apes, despised." (65)
Read the full passage on Quran.com