  Planet formation is directly linked to the birthing environment that
protoplanetary disks provide. The disk properties determine whether a giant
planet will form and how it evolves. The number of exoplanet and disk
observations is consistently rising, however, it is not yet possible to
directly link these two populations. Therefore, a deep theoretical
understanding of how planets form is crucial. We performed numerical
simulations of planet formation via pebble and gas accretion, while including
migration, in a viscously evolving protoplanetary disk, with dust growing,
drifting, and evaporating at the ice lines. In our investigation of the most
favorable conditions for giant planet formation, we find that these are high
disk masses, early formation, and a large enough disk to host a long-lasting
pebble flux. However, small disks with the same mass allow more efficient gas
accretion onto planetary cores, leading to more massive gas giants. Given the
right conditions, high viscosity leads to more massive cores and it enhances
gas accretion. It also causes faster type II migration rates, so the giants
have a decreasing final position for increasing viscosity. Intermediate dust
fragmentation velocities provide the necessary pebble sizes and radial drift
velocities for maximized pebble accretion and pebble flux. An enhanced
dust-to-gas ratio can compensate for lower disk masses, but early formation is
still crucial. We conclude that there is no specific initial parameter that
leads to giant planet formation; rather, it is the outcome of a combination of
complementary factors. This also implies that the diversity of the exoplanet
systems is the product of the intrinsic diversity of the protoplanetary disks
and it is crucial to take advantage of the increasing number and quality of
observations to constrain the disk population properties and ultimately devise
planet formation theories.
