The phases of the moon are determined by the angle at which sunlight approaches the moon relative to the position of the Earth. When the sun is behind the Earth, relative to the moon, full sunlight falls on the hemisphere of the moon that faces Earth. When the sun is behind the moon, relative to Earth, sunlight falls on the opposite lunar hemisphere.
When sunlight falls on the lunar highlands, located on the side of the moon that never faces Earth, Earthbound observers see only the half of the moon that is in shadow. This is the phase referred to as a new moon. Two weeks later, when the moon has swung around to the opposite point in its orbit, full sunlight falls on the hemisphere that always faces Earth. This illuminates the entire hemisphere and is seen on Earth as a full moon.
During times in the lunar orbit when sunlight approaches the Earth-moon system at right angles, only half of the moon's near side is illuminated. Depending on whether the right or left half of the moon is visible, this produces either a first-quarter moon or a third-quarter moon. The transition from a full moon to a new moon is continuous, with the moon's shadow gradually passing across the visible surface from right to left.