It doesn't.
(Sorry. While I'd love to give you that "short" answer ... I first have to explain the error in the question, and then explain BOTH carbon dating AND how you date fossils.)
You don't use carbon dating for dating fossils.
You use *radiometric* dating for dating fossils.
Why can't you use carbon dating on fossils? Two reasons:
(A) Carbon dating looks at the carbon atoms in *once-living tissue* (like bone, wood, leather, paper, cloth). A fossil is not "once-living tissue". A fossil is made out of rock.
(B) Carbon dating is limited to a range of about 60,000 years at most. Most fossils are in the *millions* of years old.
So carbon dating can be used to date a 20,000-year-old *bone* ... but not a 20-million-year-old *fossil*.
----
(So since it's not clear if you're asking how carbon dating works or how to date fossils ... now I have to explain *BOTH*.)
Both carbon dating and radiometric dating use the same principle. Namely, radioactive isotopes decay at a known rate. So if we know the *ratio* of an isotope to another more stable atom at the time the object was created, then we can tell the age of the object by seeing how much that ratio has changed ... i.e. how much that isotope has decayed.
Carbon dating uses the isotope carbon-14. There is a known ratio of C14 to normal C12 in the atmosphere, and C14 decays to nitrogen at a known rate (which is a gas and disappears from the tissue). So since a living thing is fixing carbon atoms into its body from CO2 in the atmosphere, and since it stops taking on new carbon atoms when it dies, then centuries later we can measure the C12 to C14 ratio in the tissue and know how old it is.
An example of *radiometric* dating is Potassium-Argon dating. Potassium-40 decays to Argon-40 (at a *much* slower rate than the decay of C14). Since the process of lava forming into rocks can leave trace amounts of Potassium but not Argon (since argon escapes as a gas) ... millions of years later, any Argon we find trapped in the rock has to be the result of the Potassium-to-Argon decay. So the ratio of Potassium-40 to Argon-40 in the rock tells us how old it is.
So if a fossil is in the same layer as a rock that we can date using Potassium-Argon dating, or any of a dozen other radiometric methods ... then we know the age of that fossil.
(P.S. technically carbon dating is a *type* of radiometric dating.)
Source(s):
(For more information, look up "radiometric dating" in wikipedia ... great explanation ... but I get an error whenever I link it here.)