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. Giant planets are not the most common exoplanets, but their presence in a disk can have significant consequences for the evolution of the disk itself and the planetary system undergoing formation. Their presence also offers more chances of spotting observational features in the disk structure. 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, so that efficient core growth can take place before the pebble flux decays over time. Specifically, core growth needs to start before 0.9 Myr to form a giant, with an initial disk mass of 0.04 M⊙ (or higher) and the disk radius needs to be larger than 50 AU. However, small disks with the same mass allow more efficient gas accretion onto already formed planetary cores, leading to more massive gas giants. Given the right conditions, high viscosity (α = 10−3) leads to more massive cores (compared to α = 10−4) and it also enhances gas accretion. At the same time, it causes faster type II migration rates, so the giants have a decreasing final position for increasing viscosity. Intermediate dust fragmentation velocities, between 4 and 7 m s−1, provide the necessary pebble sizes and radial drift velocities for maximized pebble accretion with optimal pebble flux. The starting location of a planetary embryo defines whether a giant planet will form, with the highest fraction of giants originating between 5 and 25 AU. Finally, a dust-to-gas ratio of 0.03 can compensate for lower disk masses with fDG ≤ 0.015, but early formation is still important in order to form giant planets. 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.