After creating light on day one, God now makes permanent sources of light for the Earth.
Genesis 1:14-19 And God said, Let there be lights in the firmament of the heaven to divide the day from the night; and let them be for signs, and for seasons, and for days, and years: 15 And let them be for lights in the firmament of the heaven to give light upon the earth: and it was so. 16 And God made two great lights; the greater light to rule the day, and the lesser light to rule the night: he made the stars also. 17 And God set them in the firmament of the heaven to give light upon the earth, 18 And to rule over the day and over the night, and to divide the light from the darkness: and God saw that it was good. 19 And the evening and the morning were the fourth day.
The main purpose of the lights would be to “divide the day from the night” (vs. 14). This describes what our sun and moon do. These are the “two great lights” in verse 15—one for the day and the other for the night. We understand that the moon does not produce its own light but merely reflects the sun. This does not affect the accuracy of the biblical text. The moon still provides light at night regardless. Reflected light is still light. No doubt our ancestors understood that the moon was reflecting light given the observable changes in it over the lunar cycle.
The other purposes of the sun and moon would be “for signs, and for seasons, and for days, and years”. For all practical purposes, we base our understanding of time upon the movements of the sun and moon. The word “month” is related to the word “moon” and reflects that it was originally used to describe the lunar cycle. Our year is the time it takes the Earth to travel around the sun. Our day is one revolution of the Earth on its axis resulting in a period of sunlight and of moonlight (day and night).
God “made the stars also” (vs. 16). They are not given much attention in the creation narrative, but the stars are an enormous part of our universe. There are literally billions of stars in the Milky Way galaxy alone. That God didn’t say much about them in this passage underscores the fact that His purposes would be played out primarily through the Earth and its inhabitants.
It has been theorized that the fourth day is when God made the angels. They are described as “morning stars” in Job 38:7. This is a matter of debate, but it is sure that the angels are created beings and most likely were made during the six days of creation. So this view has merit, but the issue itself is not one of great significance in Christian doctrine.
All of this again is described as “good” and the fourth day was completed.