Earth does not keep the same distance from the Sun all year. Around 3 January it is about 147.10 million km away and moving at 30.29 km/s. Around 4 July it is about 152.10 million km away and moving at 29.29 km/s. Nothing is pushing the planet along, so what sets that pace?
Seasons come from Earth's tilt, not from this distance. In fact Earth is closest to the Sun in the northern winter.
The planet below circles the Sun. The orbit is cut into 12 slices of equal time, so each wedge is what the planet sweeps in one twelfth of its year. Drag the dot on the far side of the orbit to stretch it, or tap a preset. The wedges change shape. Watch what happens to their area.
Johannes Kepler published the rule in his 1609 book Astronomia nova, after years of wrestling with the orbit of Mars using Tycho Brahe's observations. It reads: a line from the Sun to a planet sweeps out equal areas in equal times. He found it before he found that orbits are ellipses. Near the Sun the wedge is short and fat, so the planet must cover a long stretch of orbit to fill it. Far from the Sun the wedge is long and thin, so a short stretch is enough.
Take one very thin wedge. It is almost a triangle, and its area is half the distance to the Sun times the sideways distance the planet moved across the line of sight to the Sun. Sideways motion is the only part that sweeps area. Gravity pulls the planet straight toward the Sun. It can speed the planet up or slow it down along that line, but it never gives the sideways motion a twist. So the distance multiplied by the sideways speed stays fixed.
That is conservation of angular momentum, the same rule that makes a skater spin faster when she pulls her arms in. Close to the Sun the distance is small, so the sideways speed must be large. Newton's Principia (1687) made the link: the second law does not depend on gravity falling off as the inverse square. It holds for any force that points straight at the Sun.
At the nearest and farthest points the motion is entirely sideways, so speed is simply inversely proportional to distance. The ratio of fastest to slowest speed is then (1 + e) / (1 − e), where e is the eccentricity of the orbit.
For Earth, e is 0.0167, giving a ratio of about 1.03. That matches the 30.29 and 29.29 km/s above: only a 3% swing. Mercury has e of about 0.21, so it is roughly 1.5 times faster at its closest than at its farthest. Halley's comet has e of 0.967, with a closest approach of about 0.59 au and a farthest point of about 35 au. By this rule it moves about 60 times faster at the near end. Its measured speed at the far end was about 0.91 km/s in December 2023, which implies roughly 54 km/s near the Sun.
Tap the Halley button and watch the comet. It crawls along the far side of the orbit, then whips around the Sun and fills a wedge in a blink. Every wedge still holds exactly the same area.