There are many types of generators. We have hydroelectric generators that use the potential energy of water to convert it into kinetic energy, and the kinetic energy into electrical energy.
Wind turbines use the kinetic energy of wind to rotate with the generator and convert it into electrical energy.
There is also thermal energy production and nuclear energy production. But they all convert the energy existing in nature into electrical energy. The so-called generator involves converting other forms of energy into electrical energy.