Domestic solar panels explained

How do solar panels work, and how are they installed on residential buildings?