Why do the Sun and Moon look almost the same size?
Keep the Sun fixed and move the Moon along the same line of sight. A small change in distance can turn a total eclipse into a ring of sunlight.
Measure the angle between the edges
Hold a coin in front of a distant object and move the coin closer to your eye. Its diameter stays the same, while the angle between its two edges grows. The Sun is roughly 400 times as wide as the Moon and roughly 400 times farther away. Both therefore span about half a degree in Earth's sky.
Change just one distance
The Moon's orbit brings it closer to Earth and carries it farther away. Its apparent diameter grows when it is closer. Earth's orbit changes our distance from the Sun as well, so the solar disk also varies slightly in size. Holding the Sun fixed in the calculation lets you see what the Moon's distance does on its own.
Calculate which disk wins
Use a calculator indoors. For these small angles, divide the object's diameter by its distance, using kilometres for both, and multiply by 57.3 to get degrees. For a Sun 1,392,000 km wide and 149,600,000 km away, expect about 0.53°. Now use a Moon 3,475 km wide. At 363,300 km it spans about 0.55°. At 405,500 km it spans about 0.49°. With the two disks centred on each other, the nearer Moon covers the Sun and the farther Moon leaves a ring. In the illustration the dashed orange line marks the covered solar edge. These are rounded example distances.
Put the observer back in the picture
A solar eclipse requires a new Moon close to a crossing of the Moon's orbit and Earth's orbital plane. During the same eclipse, an observer inside the narrow central path may see totality or a ring, while someone farther from the path may see only part of the Sun covered. Predicting the view from a real location requires the directions and angular sizes of both disks as seen from that location. Use the calculation or the illustration for this exercise, and consult NASA's viewing guidance before observing the Sun.