how does alternating current prevent power loss over each cycle with the current moving back and forth?

Verified Answer :

AL2006

At every instant, the power dissipated by anything that has
current flowing through it is ...

        (the voltage between the ends of the thing)
times
        (the current flowing through the thing)  ...

... no matter which direction the current is flowing in it.

The act of reversing the direction of the current in a conductor,
or the act of reversing the polarity of the voltage between its ends,
doesn't require any power to accomplish.