According to scientific understanding, the Earth was formed before the sky. The Earth's formation is believed to have occurred around 4.5 billion years ago through the process of accretion, where dust and gas in the early solar system came together to form our planet. The sky, on the other hand, is a result of the Earth's atmosphere and the presence of gases and particles that scatter sunlight, creating the appearance of a blue sky during the day and a dark sky with stars at night.