They were all blasted off the Red Planet by some asteroid or cometary impact, and then spent millions of years travelling through space before falling to Earth.
There might be even more: the measurements probe only the top half-metre of regolith, but it is thought that cometary bombardment could have left ice in the top two metres.