How does earth's formation differ from that of Mars?
there is no difference, they each formed at the same time and in the same manner
The historical difference between the two is Earth has a liquid interior which creates a large electro-magnetic field. This field in turn deflects the suns rays and prevents those rays from boiling off our atmosphere. Mars has a solid core and a negligible electro-magnetic field and because of that, whatever atmosphere Mars once had has been mostly eradicated. It still has an extremely thin atmosphere.