How is energy generated?

How is energy generated?