This is due to the rotation of the Earth on its axis. As the Earth spins, it appears as if the celestial objects are moving across the sky.
However, it's important to remember that the Sun, Moon, and stars are not actually moving across the sky. The Earth's rotation creates the illusion of movement.