The Moon doesn’t shine on its own; it reflects the light of the Sun. Its surface is covered with dust and rocks that reflect sunlight back towards Earth.
During the night, the part of the Moon illuminated by the Sun is visible from Earth, and that’s what we perceive as its brightness.
The Moon goes through phases due to its orbit around Earth, changing the amount of its visible surface and its appearance. This phenomenon of reflecting sunlight is what makes the Moon shine in the night sky.