  Planetary population synthesis is a tool to understand the physics of
planetary system formation. It builds on a model that includes a multitude of
physical processes. The outcome can be statistically compared with exoplanet
observations. Here, we review the population synthesis method and then use one
population to explore how different planetary system architectures emerge and
which conditions lead to their formation. The systems can be classified into
four main architectures: Class I of near-in situ compositionally ordered
terrestrial and ice planets, Class II of migrated sub-Neptunes, Class III of
mixed low-mass and giant planets, broadly similar to the Solar System, and
Class IV of dynamically active giants without inner low-mass planets. These
four classes exhibit distinct typical formation pathways and are characterised
by certain mass scales. Class I systems form from the local accretion of
planetesimals followed by a giant impact phase, and the final planet masses
correspond to the `Goldreich mass'. Class II systems form when planets reach
the `equality mass' (equal accretion and migration timescales) before the
dispersal of the gas disc, but not large enough to allow for rapid gas
accretion. Giant planets form when the `equality mass' allows for rapid gas
accretion while the planet are migrating, i.e. when the critical core mass is
reached. The main discriminant of the four classes is the initial mass of
solids in the disc, with contributions from the lifetime and mass of the gas
disc. The breakdown into classes allows to better understand which physical
processes are dominant. Comparison with observations reveals certain
differences to the actual population, pointing at limitation of theoretical
understanding. For example, the overrepresentation of synthetic super Earths
and sub-Neptunes in Class I causes these planets to be found at lower
metallicities than in observations.
