Rocks, including meteorites, can be dated by looking at the ratios of certain radioactive isotopes (a method analogous to ‘radiocarbon dating’). Most meteorites turn out to be about 4.56 billion years old, because they come from asteroids that date from the creation of the Solar System. Anything younger must be from a planet or moon.
Scientists have found that the ratios of oxygen isotopes in meteorites are different for each parent body. Furthermore, some meteorites are found to have trapped gases whose isotopic composition exactly matches what has been measured for the atmosphere on a particular planet. Together, these strands of evidence make the origin of most meteorites pretty certain.