What does the headset do on a bmx?

The headset is a set of bearings that allows the fork to turn smoothly in the head tube of the frame w/o sticking wobbling around when you turn the handle bars.