The metallicity of a star, we might recall, measures how much of its material consists of elements heavier than hydrogen and helium, that is, those elements that were manufactured in earlier generations of stars that subsequently spewed their contents across the cosmos. Our Sun, for example, has about 1 iron atom for every 20,000 hydrogen atoms. Metallicities of other stars are measured on a logarithmic scale on which the Sun is defined to have metallicity zero. Thus, a star with metallicity -4 has an iron fraction only 1/10000 that of the Sun (1 iron atom for every 200 million hydrogen atoms). The most metal poor stars of all seem to have metallicities of about -4.5, while the most metal rich are near 1, with ten times more iron than the Sun. Since the very first generation of stars had no metals at all, these would have been off the scale in the negative direction, but none of these so-called Population III stars seem to have survived to the present.
The kinds of planets a star can have seems to depend on the metallicity. The first extrasolar planets detected were the "hot Jupiters," gas giant planets very close to their stars, often well inside the orbital distance of Mercury, some with orbital periods of less than a day. From Kepler's third law, orbital radius scales like the 2/3 power of period, so such a planet would be very close to its star. The existence of such planets was a surprise, but they seem to be very common in metal rich stars, and such stars seem to have lots of them.
So how do gas giants form? The main answer seems to be "quickly." The initial star and its protoplanetary disc have both gas and dust. The dust condenses to to planetesimals which in turn assemble into rocky and metallic planets. If there is still hydrogen and helium around, and they are large enough, they can attract hydrogen and helium to become gas giants, but they have only a few million years, because then their star heats up and blows the hydrogen and helium out into interstellar space. Higher metallicities mean more dust, and presumably faster planetary formation, which probably accounts for more gas giants in such systems.
Via David Spergel's Coursera/Princeton class Imagining other Earths - especially the interview with Debra Fisher, one of the more prolific planet finders.