Historians don't have "right answers" for really old things.However, carbon dating has done well on young material like the Dead Sea Scrolls, the Minoan ruins, and acacia wood from the tomb of the pharoah Zoser.In short, unless you have evidence to the contrary, you should assume that most of the carbon in a fossil is from contamination, and is not originally part of the fossil. The nuclear tests of the 1950's created a lot of C14.Also, humans are now burning large amounts of "fossil fuel".It is sometimes possible to match up tree-ring patterns between different trees.
So we only have to know two things, the half-life of carbon-14 and how many carbon-14 atoms the object had before it died. However knowing how many carbon-14 atoms something had before it died can only be guessed at.
It is produced in the upper atmosphere by radiation from the sun.
(Specifically, neutrons hit nitrogen-14 atoms and transmute them to carbon.) Land plants, such as trees, get their carbon from carbon dioxide in the air. The same is true of any creature that gets its carbon by eating such plants. Suppose such a creature dies, and the body is preserved.
Dates derived from carbon samples can be carried back to about 50,000 years.
Potassium or uranium isotopes which have much longer half-lives, are used to date very ancient geological events that have to be measured in millions or billions of years.