How does solar power save energy?

Energy is usually created from fossil fuels, and if they Sun provides unlimited energy, than using sunlight for solar powered energy can save a ton of energy.