Carbon 14 is used to date things that were once living and in equilibrium with the atmosphere.
Here is a brief explanation of how the method works from ray protons blast nuclei in the upper atmosphere, producing neutrons which in turn bombard nitrogen, the major constituent of the atmosphere .
The Carbon-14 within a living organism is continually decaying, but as the organism is continuously absorbing Carbon-14 throughout its life the ratio of Carbon-14 to Carbon-12 atoms in the organism is the same as the ratio in the atmosphere.
Once an organism dies it stops taking in Carbon in any form.
Why does dating sedimentary rock or these fossils often show traces of carbon 14? Sedimentary rock can contain pockets gas that would reflect the atmosphere when the rock was formed.