In traditional typography, the space taken up by a capital letter M and the mandatory whitespace around it is always a square. The height or width of the square, an "em", is used as a unit of space used by the text. For example, from that definition, one em is the height of a line of text with the ascender and descender spaces included but without any additional inter-line spacing.
The actual size of an em in points (if you're talking about paper) or pixels (if you're talking about computers) depends on the typeface and size of the font you've chosen.
Browsers etc. get this information from the font, which has a table that provides constants of this sort which they can use to guide rendering of text.