Abstract: The discovery of thousands of exoplanets revealed a huge variety in the sizes, masses, and orbital properties of planets outside of our solar system. I will discuss how the physics of gas accretion and dust-gas interaction can shape the observed diversity, providing explanations for some of the most puzzling demographic patterns that have emerged in exoplanet science, from close-in rocky planets to far-out gas giants. I will conclude by discussing future directions towards charting the full trajectory of planet formation and evolution, combining theoretical and observational investigations.