The moon is a satellite of our earth and it does not have its own light. It either receives light from the sun or it is illuminated by the light that the earth reflects. We can see parts of the lunar hemisphere that receives light. To understand the reason why the moon goes through different phases, we need to know how much time it takes to rotate around the earth.
The moon orbits the earth in an elliptical orbit. The time that lapses between two totally similar lunar phases is 29.5305 days. The time that moon needs to complete one orbit around the earth is 27. 3217 days. The difference in time between the orbital period and the synodic period stems from the fact that the earth is also continuously moving and progressing in its journey around the sun.
When we can see the side of the moon that is facing earth completely, it is called the full moon and when we can see just the shadow of moon then it is called the new moon. The different phases of the moon are a result of varying positions of the celestial bodies. When the moon comes between the earth and the sun then we cannot see the moon at all because the side of the moon facing earth receives no light.
When the earth comes between the sun and the moon and all three are in a straight line we can see a full moon. When there is a 90 degree angle between the moon and the earth and sun, then we can see exactly half of the moon. The different phases of the moon like waning crescent, waxing crescent, first quarter, third quarter and waning gibbous are a result of the angle between the moon and the earth.