The many planet discoveries by the Kepler satellite have revolutionised our
view of planet formation and evolution. I will talk about the main models for
planetary formation and how the various steps of planet formation affect the
observed properties of exoplanets. I will focus on the connection between the
stellar metallicity and the properties of the planetary system. Surprisingly,
while gas giant planets appear to form only in environments rich in heavy
elements, small planets form around stars with a wide range of metallicities.
This has major implications for the possibility of life elsewhere in the
Galaxy.