The sun and moon appear to be the same size because of a surprising coincidence; the moon is 400 times smaller but 400 times closer.
Believe it or not, it actually is just a coincidence and a happy one at that. The Moon and Sun have virtually the same angular size in our sky because the Sun is about 400 times wider than the Moon, but it's also about 400 times farther away. This allows us to see spectacular coronal displays and prominences during total solar eclipses. Interestingly, this hasn't always been the case.
Tidal interactions cause the Moon to spiral about one inch per year away from Earth. In the distant past, the Moon was close enough to Earth so that it could block the Sun's entire disk and then some. Our prehuman ancestors would not have witnessed the beautiful coronal displays that we now enjoy. And about 50 million years from now, the Moon will be far enough away so that our descendants will only see annular eclipses.
So why do we happen to live in the brief period of Earth's history when the moon just barely blocks the sun? Indeed, the odds against it are enormous. But the universe is a large enough place so that highly improbable coincidences can and do occur. It's important to note, however, that even today some solar eclipses are annular because the Earth and Moon have elliptical orbits.