The carbon has lost a bonding pair, so it has six valence electrons, a positive charge and an empty p orbital perpendicular to its flat, sp² framework.
A primary carbocation has one alkyl neighbor, so few nearby bonds can help and the positive charge stays crowded on one carbon.
In hyperconjugation, a C–H bond on the neighboring carbon lines up with the empty p orbital and lends it some electron density, spreading the charge.
A tert-butyl cation has three methyl groups, so nine C–H bonds can feed the empty orbital, and the alkyl groups also donate inductively.
The more the charge is spread, the lower the energy: tertiary is lowest, then secondary, then primary. Resonance with a neighboring π bond helps even more.