The moon does not produce its own light. We can only see the moon because it reflects sunlight. The amount of the reflected sunlight that reaches the Earth is determined by the relative positions of the Earth, moon and Sun, and determines the phase of the moon.
Most of the time we only have a partial view of the moon, because the Sun does not vlight the whole of the side of the moon as viewed from Earth unless the Sun, moon and Earth are lined up, in that order. This only happens about once every twenty seven days – the time the moon takes to orbit the Earth once. The different appearances of the moon as seen from Earth are given different names, shown on the diagram above. As the moon orbits, it also rotates on its axis, once every twenty seven days also, so that the same side of the moon is always turned towards us.