Asylum seekers lie about their age because firstly it gives them a greater chance of getting asylum, and secondly, even if their claim fails they will be granted leave while they are still a child. There is the added difficulty that a lot of people from parts of the world where asylum seekers are commonly from don't actually know how old they are.
There are a number of tests in terms of age dispute cases. Firstly, if Home Office officials deem a person to be obviously an adult (25 or over), they can say so, and unless the person produces evidence to the contrary, they're treated as an adult. Xrays for non medical reasons are not permitted. Other medical evidence can be considered, but much of it has been widely discredited (and the standers deviations involved meant that a person claiming to be 17 could have been anywhere between 12 and 25, for example). Disputed cases are referred for an age assessment by social services which has to comply with certain criteria (called "Merton compliant"). This tends to give benefit of the doubt in borderline cases.
Basically, there is no proven way to conclusively assess age, especially when ethnic, cultural and life experience backgrounds are taken into account. But the entire asylum system is based on the premise that it is better to give the benefit of the doubt and believe an individual who might be lying, rather than apply too high a test and risk sending individuals back when their life is at risk