The lunar phases are produced as a result of the change of the relative positions of the Earth, the Moon and the Sun.
The part of the lunar surface illuminated by the Sun that we can see from the Earth, is changing throughout a cycle that is repeated periodically every 29 days, 12 hours, 43 minutes and 12 seconds.
The answer is: The earth that revolves around the sun and the light of the sun is reflected in the moon, is what produces the lunar phases.