The vast majority of world bikes have threads on the top of the head tube and big nuts
that clamp the headtube onto the bearings. Bike shop bikes use internal threads
and screws inside the head tube that clamp on spacers that clamp on the bearing
The fork on a bike with a threaded headset is held in place by a nut that screws onto the end of the fork which is threaded. This keeps the fork attached independent of the stem.
The fork on a bike with a threadless headset is held in place by the stem which clamps to the end of the fork which is unthreaded. In order for this style fork to remain in place, the stem much be attached.