The coil is rotated rapidly in the magnetic field.
The magnetic flux linked with the coil changes and thus, an emf is induced which leads to the flow of current .
when the coil rotates and is in a position along the direction of the magnetic field, emf is maximum while when it is perpendicular to the magnetic field,emf is 0.
Thus an ac generator converts mechanical to electrical energy.It works on the principle of electromagnetic induction. The polarity at the supply terminals changes like.. 100 times a second if the frequency is 50 Hz(50 times+ and 50 times - )
hope it helps!