Earth completes a spin before the clock completes a day. That mismatch is not a flaw in the clock: it is the consequence of a planet turning on its axis while traveling around the Sun. One motion gives us daylight and darkness; the other makes noon arrive a little later.
The daily change is a matter of orientation, not distance. As Earth rotates, the side facing the Sun receives sunlight while the other side lies in darkness. The boundary between them, called the terminator, moves across the surface. Dawn follows its passage into light; dusk marks the passage into shadow. Earth's tilted axis complicates the picture, changing the length of daylight with latitude and season, but rotation drives the basic cycle.
The clock tells a different story from the stars. A sidereal day, measured by Earth's rotation relative to distant stars, lasts about 23 hours and 56 minutes. During that spin, Earth also moves along its orbit, shifting the Sun's apparent position against those stars. Earth must therefore turn a little farther before the Sun returns to roughly the same position in the sky. Those extra degrees take about four minutes, making the average solar day roughly 24 hours. Individual solar days vary slightly because Earth's orbit is elliptical and its axis is tilted. At noon, the clock keeps an average; the Sun keeps its own counsel.