To add more to what Happy Koala wrote (this would be a comment but I don't have the rep. yet to post comments): if you try to model the solar system without planetary migration, you get an Earth-sized (or larger) planet where Mars is and several high-inclination / eccentricity Mars-sized objects in the asteroid belt. There's now an increasingly high degree of confidence that planetary migration did, in fact, occur.
Specifically, Jupiter gorged on the combination of having a high radius before the dropoff in density in the protoplanetary disc, boosted by volatiles being blasted away from the inner solar system, and quickly became a large, dominant body in the solar system. It slowly migrated inwards (casting icy material from the outer solar system into the inner solar system in the process). It reached all the way to where Mars is today and cleared the zone between Mars and Earth's present orbit (casting a good chunk of this material into the outer solar system). However, during this time Saturn had slowly been forming, and the action of Saturn slowed and ultimately reversed Jupiter's inward migration. Jupiter slowly migrated outward to its current position, casting material into what is now the asteroid belt in the process.
Venus, and Earth formed from material in their respective orbits, a combination of original material and material cast in by Jupiter. Mars however had to wait for scraps being cast in by Venus/Earth or Jupiter; there was little to accrete in its zone. As a consequence, it ended up much smaller. In the process of accretion, all of the inner planets moved around, although not as much as the giants. This includes not just semimajor axis but inclination and eccentricity as well.
As to how Mars retained liquid water, it used to have a more substantial atmosphere, but its low gravity and lack of a magnetic field led to the atmosphere's loss by the solar wind. This can be clearly seen in its hydrogen and nitrogen isotopic ratios, both of which are well enriched in their heavier isotopes, as lighter isotopes escape more readily. Venus, while having lost little nitrogen due to its size, is even more water-depleted than Mars; Mars has a 5-7 times higher D:H ratio than Earth, while Venus has a 150-240 times higher ratio. It's amazing and kind of sad to think about how Earthlike Venus used to be.