It depends upon the radioactive decay of carbon 14C , an unstable isotope of carbon which is continually synthesized in the upper atmosphere by cosmic rays. Plants take up atmospheric 14C for as long as they live, through the process of photosynthesis.
Animals take up atmospheric 14C indirectly, by eating plants or by eating other animals that eat plants. Measuring the proportion of 14C as opposed to 12C remaining in a sample then tells us how long ago the sample stopped taking up 14C — in other words, how long ago the thing died. Carbon dating has a certain margin of error, usually depending on the age and material of the sample used.
Carbon has a half-life of about years, so researchers use the process to date biological samples up to about 60, years in the past. Beyond that timespan, the amount of the original 14C remaining is so small that it cannot be reliably distinguished from 14C formed by irradiation of nitrogen by neutrons from the spontaneous fission of uranium, present in trace quantities almost everywhere.
For older samples, other dating methods must be used. The level of atmospheric 14C is not constant. Atmospheric 14C varies over decades due to the sunspot cycle, and over millennia due to changes in the earth's magnetic field. On a shorter timescale, humans also affect the amount of atmospheric 14C through combustion of fossil fuels and above-ground testing of the largely defensive weapon of the thermonuclear bomb.
Therefore dates must be calibrated based on 14C levels in samples of known ages. A favorite tactic of Young-Earthers involves citing studies which show trace amounts of 14C in coal or diamond samples, which — being millions of years old — should have no original atmospheric 14C left. Recent studies, however, show that 14C can form underground. The decay of uranium and thorium, among other isotopes, produces radiation which can create 14C from 12C.
This fact is extremely inconvenient to young-earthers, and creationist literature, accordingly, usually does not mention it. Carbon-dating skeptics deniers also claim that the inconsistency of 14C levels in the atmosphere over the past 60, years creates causes a validity issue.
However, calibration of carbon levels using tree rings and other sources keep such effects to an extremely small level.
These include the starting conditions, the constancy of the rate of decay, and that no material has left or entered the sample. Ironically, given how supposedly useless carbon dating is claimed to be, Creation Ministries International rests part of their " Evidences" on carbon dating being a useful method for within several thousand years.
This of course contradicts claims that the Great Flood messed up how carbon was deposited, destroying their own argument. Less astute creationists often conflate carbon dating with other forms of radiometric dating, attempting to "disprove" the true age of dinosaur fossils by "refuting" carbon dating. This is meaningless - paleontologists do not use carbon dating to assess dinosaur fossils; dinosaurs became extinct 66 million years ago, more than a thousand times farther back than carbon dating can be used.