Hi,
Adjustable LDOs have, for example, a 1.2V reference fed to one of the error amplifiers inputs, and the feedback resistors are scaled to create 1.2V at the other input to the error amplifier. As AMSO12 said, it always seems to be a bandgap reference. I don't know how fixed regulators do this as I was researching adjustable, I think it will be the same method. There are a lot of application notes about LDOs if you have a quick search, well worth reading.
slva072: "Technical Review of Low Dropout Voltage Regulator Operation and Performance"
"LDO operation can be explained using the NMOS series pass element I-V characteristics shown in Figure 2. NMOS devices are not widely used in LDO designs, but they simplify the explanation of LDO performance. Figure 2 (a) shows the two regions of operation—linear and saturation. In the linear region, the series pass element acts like a series resistor. In the saturation region, the device becomes a voltage-controlled current source. Voltage regulators usually operate in the saturation region."