The Moon's position changes with respect to Earth and the Sun.
As the Moon moves, the Sun lights up different parts of its surface. This is why the Moon seems to change shape. When the side facing Earth is lit up, you can see the Moon as a bright circle. Sometimes, you can only see part of the side that is lit by the Sun. When the Sun shines behind the Moon you can't see the bright side, so it looks dark.