Allah states that there is no God but He. The idolators who worshipped others besides Him recognized that He was the sole creator of the heavens and earth, the sun and the moon, alternating the night and day. They acknowledged that He was the Creator Who provided for His servants and decreed how long they should live. He made them and their provision different, so that some were rich and some were poor, and He knew best what was suitable for each of them, who deserved to be rich and who deserved to be poor. So, Allah stated that He has alone created everything, and that He alone is controlling them -- if this is how it is, then why worship anyone else Why put one's trust in anyone else Since dominion is His Alone, then let worship be for Him Alone. Allah often establishes His divinity by referring to their acknowledgement of His Unique Lordship, because the idolators used to acknowledge His Lordship, as they said in their Talbiyah (during Hajj and `Umrah: "At Your service, You have no partner, except the partner that You have, and You possess him and whatever he has."
Ma'arif al-Qur'an
Mufti Muhammad ShafiOn ayahs 61–63
After stating the real source of sustenance for all, that is the bounty of Allah Ta’ ala, it is said that if you ask the infidels as to who has created the earth and the skies, or who controls the movement of the sun and the moon, or who brings in the rain, and who makes the vegetation grow; then even they will admit that it is all controlled and done by One entity, that is Allah Ta’ ala. In the next sentence it is advised to ask them as to why do they then worship any other than Allah and regard it as their mentor. From the next verse وَلَئِن سَأَلْتَهُم مَّنْ خَلَقَ السَّمَاوَاتِ وَالْأَرْضَ (And if you ask them as to who has created the heavens and the earth - 29:61) until the end of the ruku` this subject continues.
Sometimes a change is necessary in the mode of performing a task. This may require a change in the sphere of influence, in the way that the Hudaybiyah Pact shifted the scene of action from the battlefield to the field of missionary work. But more often, it requires a major step, like migration, for example, the migration of the Prophet from Makkah to Madinah. In these verses the faithful living in Makkah were told that if the people of Makkah were harassing them, they should leave Makkah, migrate to some other place, and carry on God’s worship there. This shows that the exercise of patience and trust means being steadfast in prayer and not persisting in clashing with enemies. Had it been God’s will that they should engage in hostilities under any circumstances, then the instructions would have been to continue fighting with their opponents and not in any event to move away.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.