It has to do with apparent size of the sun and moon. The sun is 400 times wider than the moon and coincidentally 400 times further away, so they look the same size. With no other reference points as to how big each object is, we perceive them to be the same distance.