Solar panels are made of photovoltaic (PV) cells, usually silicon. When sunlight hits a cell, it knocks electrons loose and creates a flow of direct current (DC) electricity — this is the photovoltaic effect.
That DC power flows to an inverter, which converts it into alternating current (AC) — the type your home appliances and the grid use. From there it powers your home first; any surplus is stored in a battery (if you have one) or exported to the grid.
Panels produce the most on clear, sunny days, but they still generate power in cloudy weather — just less. No sunlight at night means no production, which is why homes stay connected to the grid or a battery.
This is general guidance — figures vary by location, tariff, equipment and installer. Always confirm details for your own home before deciding.