The scales have your Weight, Height, Age, and Sex, which is actually enough to approximate all the figures you've listed (+/- 4%), but in addition it takes a BIA (Bioelectrical Impedance Analysis) reading. Essentially the scales incorporate a multimeter, similar to those found in the average electricians toolbox, and it measure by how much a small current is delayed and reduced by being passed up one leg and down the other (Impedance). As different materials have known Impedance values a guess as to the volume of water can be made (+/- 3%), and from your weight, height, age and a few known ratios, and a few formula that approximate how the composition of the body changes with age, a few more numbers can be derived from the estimated water content.
It's worth noting that the formula incorporated into the device have known margins of error, and those margins are based on readings taken on an AVERAGE individual. So the less AVERAGE you are the greater the error is going to be.
A few of the common formula (see Wikipedia for the constants):
BMI = MassKg / (HeightM)^2
BMR (Basal Metabolic Rate) = a + (b * MassKg) + (c * HeightM) - (d * ageYears)
where: a, b, c, and d are constants that vary depending on your sex, and whose version of the equation you use.
LBM (Lean Body Mass) = ( x * massKg ) + ( y * HeightM) - z
where: x, y, and z are constants that vary depending on your sex, and whose variation of the equation you use.
BF (Body Fat) = ((massKg - LBM) / massKg) * 100
or = (e * BMI) + (f * ageYears) - g
where: e, f, and g are constants that vary depending on your sex, and whose variation of the equation you use.