XRF testing identifies lead by analyzing the characteristic X-rays emitted when a material is bombarded with high-energy X-rays. Each element emits distinct X-ray emissions, allowing the XRF instrument to precisely identify the presence of lead and quantify its concentration in the material.