How does the power get exported back to the grid?

It gets counted through an export meter and this is then credited off your power bill