A cursory follow up on the earlier and well informed posts.
The cartridge headspace pertains to the chamber as well.
The breech end of the barrel has the profile of a loaded cartridge reamed into the inside diameter of the barrel. The short and unrifled area just in front of the chamber is called the "chamber throat" or leade. On rifles this area wears with shooting ultimately requiring barrel replacement. Having a loaded projectile too close to the throat can create excessive pressures however there are always exceptions to a rule.
The headspacing is accomplished in a few different ways. On some rimmed cartridges, the rim establishes headspace in the same way as a standard revolver. The belt on belted magnums essentially works the same way. On "rimless" cartridges the case is headspaced off the shoulder (if there is one) or on the case mouth (like the 9mm or .45ACP). In all cases the area identified for headspacing is called the case "datum". This is a critical dimension and should be maintained by case forming, trimming, or swaging.
Please note that the "case head" is the thicker area at the bottom of the case where the primer and extractor groove are located. The "case head" may or may not have much to do with headspacing. Often case head separation is an indicator of worn out brass, excessive pressures, or improper annealing.