It’s a coincidence that has to do with geometry. The portion of the sky taken up by an object is directly proportional to its radius and inversely proportional to its distance from the point of view. That is to say, if an object’s radius is doubled and its distance from the Earth is also doubled, it will appear just as big when seen from the Earth. As luck would have it, the sun is both roughly 500 times more far away from the Earth than the moon and has a radius roughly 500 times that of the moon, so the two celestial bodies take up very similar portions of the sky (ie. they appear approximatively the same size from the Earth)
Latest Answers