The appearance of the sun, moon and stars on day 4, the purpose of which was to act as "signs" for seasons, day and years, was essential for those who needed the signs--animals and ultimately mankind. The second great oxygenation event about 585 million years made the appearance of the sun, moon and stars possible, just prior to the introduction of many animal species. This scientific observation fits in perfectly with the Biblical account recording days 4 and 5.
Reconciling day 1 with day 4
Reconciliation of the appearance of light on day 1 with the presumed creation of the sun on day 4 is a natural challenge to readers of Genesis 1. The resolution of this apparent problem centers on interpreting the text by 1) establishing the starting conditions and 2) noting the verb forms used.