Sunlight is harnessed and turned into DC energy. The DC energy is sent directly to an inverter, which turns that sunlight DC energy into usable AC power. Like the plugs and switches in your home.
The power will be first used up the compunction of your home and if there is any leftover power, it feeds back onto the grid. In the case of the overproduction, your power provider will give you a 1-1 credit on your power bill.
The video below is a great representation of this process.