It is an interesting coincidence that the Moon should so nearly perfectly blot out the Sun, since there is really no physical reason why this has be the case.
The Moon happens to be about 400 times smaller than the Sun, but the Sun happens to be about 400 times further from the Earth than the Moon is. That’s all folks!
So simple geometry tells us that the apparent disk of the Moon is almost exactly the size of the apparent disk of the Sun. Of course this match is not always quite the same, the Earth orbits the Sun in a modestly non-circular, elliptical, path and so our nearest and furthest distances (perihelion and aphelion) differ by about 3.3%. And the Moon’s orbit has a roughly 10% difference between its near and far point to us, so the precise degree of total solar eclipse will vary a little as the apparent sizes of Sun and Moon vary.