Solar Panels, which collect light and convert that light to DC Power, are placed on the roof, or a ground mount. DC power is what batteries produce, not what we use in our homes.
Small Inverters called "Microinverters" are placed behind the panels, and they convert the DC that the panel produces, to standard AC household power.
Power from all the inverters gets backfed to the utility, through your household electrical box. The utility meter measures the amount of power that the panels produce and the amount of power that you consume in your home. Excess power produced during the longer sunny days is credited on your electric bill, and you use this credit when you don't have as much sun, the process is known as "Net Metering".