I understand there are a few radio-dating methods to determine the age of the earth, uranium-lead to name one (maybe not the best though). The ratio Pb206 + Pb207 to U allows you to find when the uranium came into existence. What I don't understand is how this relates to the age of the earth. Can't the uranium have been rambling for 500 million years in space before lumping together with other elements to form the earth? Which would make the age of the earth in this case 4 billion years instead of 4.55 billion.
Or is it the same as with C14 dating: the C14 is formed in the higher atmosphere through interaction of cosmic rays with nitrogen atoms. This stops when the carbon enters living material, so we know then the decay starts. Is the radioactive uranium created by cosmic rays until it hits earth? But the early earth didn't have an atmosphere which would stop the cosmic rays, did it?
So I'm a bit confused. How do we know the uranium formed at the same time as the earth?