Allah Most High has sworn by many things among His creation. One of the finest discussions I have seen on this subject is that of Ibn al-Qayyim—may Allah have mercy on him—in his book al-Tibyān fī Aqsām al-Quran (Clarification of the Oaths in the Quran). It is an excellent book from which a student of knowledge can benefit greatly.
Here Allah Most High swears by the sky. The sky is everything above; whatever is above you is called sky. Even the clouds from which rain descends are called sky, as Allah Most High says: ﴿He sends down water from the sky, and valleys flow according to their measure﴾ [al-Ra'd: 17]. Since the term applies to everything above you, it includes everything between heaven and earth as well as all the heavens, for they are all above you.
As for His words, ﴿and the night visitor﴾, this is a second oath: Allah swears by the night visitor. What, then, is the night visitor? It is not someone who visits his family at night. Rather, Allah—Mighty and Majestic—explained it in His words: ﴿the piercing star﴾. This is the night visitor. The word “star” here may refer to all stars, with the definite article indicating the entire class. Alternatively, it may refer specifically to the piercing star—that is, the brilliantly shining star whose light pierces the darkness. Whatever the case, these stars are among the signs of Allah—Mighty and Majestic—demonstrating the perfection of His power through their movement and order, their differing forms, and their differing benefits as well. Allah—Blessed and Exalted—says: ﴿And landmarks; and by the stars they are guided﴾ [al-Nahl: 16]. Allah Most High also says: ﴿We have certainly adorned the nearest heaven with lamps and made them missiles against the devils﴾ [al-Mulk: 5]. Thus, they adorn the sky, serve as missiles against the devils, and constitute signs by which people are guided.
Allah then stated the subject of the oath in His words: ﴿There is no soul without a guardian over it﴾. The particle rendered “there is no” is negative here, while the expression rendered “without” means “except.” In other words, there is no soul except that a guardian appointed by Allah watches over it. Allah—Glorified and Exalted—explained the task of this guardian in His words: ﴿Indeed, there are guardians over you, noble scribes, who know all that you do﴾ [al-Infitār: 10–12]. These guardians preserve the record of a person’s deeds—what is in his favor and what is against him—and on the Day of Resurrection he will find it—