Here's how it works:
* Stars are giant balls of hot gas, mostly hydrogen and helium.
* Gravity pulls the gas inwards, creating immense pressure and heat in the star's core.
* At this extreme pressure and heat, hydrogen atoms fuse together to form helium, releasing a tremendous amount of energy.
* This energy is released as light and heat, making the star shine.
So, while we see the light from the sun reflected off the moon, the sun itself is producing its own light through nuclear fusion.