The core accretion theory is a widely accepted model for the formation of gas giants and some exoplanets. It proposes that the initial formation begins with the accumulation of a solid core, followed by the accretion of gas from the protoplanetary disk.