The basic components
A rooftop solar system has three core parts: solar panels, an inverter, and the wiring/mounting structure connecting them to your home's electrical system.
The panels are made of photovoltaic cells that generate direct current (DC) electricity when sunlight hits them. Since most home appliances run on alternating current (AC), an inverter converts the DC output into usable AC power.
What happens to the electricity generated
On a grid-connected system, the power generated is used directly by your home first. If your home needs more electricity than the system is generating at that moment, the shortfall is drawn from the grid as usual.
If the system generates more than your home is using, what happens to the surplus depends on your setup: on an on-grid system with net-metering, it may be exported to the grid; on a hybrid system, it may charge a battery instead.
What affects how much a system generates
Output depends on factors like roof orientation, tilt, shading from trees or nearby buildings, panel specification, and local weather. This is why a site assessment matters more than a generic estimate: two rooftops of the same size can perform very differently.