disk instability
There is a faster, more dramatic way to make a giant planet than building it grain by grain. Imagine a thick, swirling pancake of gas around a young star. If that disk is heavy and cold enough, its own gravity can win against the pressure trying to spread it out, and a patch of it suddenly clumps and collapses on itself — the way thick cream poured into coffee can curdle into blobs rather than smoothing out. In one swoop, a chunk of disk becomes a giant planet. This is disk instability: making a gas giant from the top down, all at once, instead of from the bottom up.
More precisely, a cool, massive disk can break into self-gravitating fragments in only a few hundred to a few thousand years — astonishingly fast compared with the millions of years core accretion needs. A fragment that holds together becomes a gas-giant-mass clump with no large solid core required at the start. For this to work the disk has to be both dense (so gravity is strong) and able to radiate away heat quickly (so pressure does not just push the clump apart again). Those conditions are met most easily in the cold, far-out parts of an unusually massive disk, tens of times Earth's distance from its star and beyond.
Disk instability is the main rival to core accretion, and it is invoked especially for massive planets found very far from their stars, where core accretion struggles to act in time. Most ordinary planets, and certainly the rocky ones, are not thought to form this way — the conditions are too special. The debate over how often nature uses each route is live, and the honest answer is that both probably happen, in different places and for different kinds of planet.
A few giant planets have been imaged orbiting their stars at enormous distances — hundreds of times the Earth-Sun gap. Core accretion struggles to build anything that far out in time, so disk instability is one suggested origin for these lonely outer giants, though their formation is still debated.
A heavy, cold disk can collapse straight into a giant planet, all at once.
Disk instability makes only massive gas giants, mostly far from the star, and needs special conditions; it does not replace core accretion for rocky planets.