I want to make this clear: SpaceX is not putting a Tesla into orbit around Mars. Not only would that be illegal by international treaty, but it would be technically impossible with the technology SpaceX currently possesses. What SpaceX is doing is putting a Tesla into a Hohmann Transfer Orbit between Earth and Mars that is very similar to the one we will likely use to get humans to that planet.
What is a Hohmann Transfer Orbit? I’m glad you asked. First, some background.
The terminology of positional astronomy is messy due to the long evolution of our understanding of the movement of celestial bodies. For this discussion, I am only going to deal with the Sun, the Earth, and Mars in defining terms. Mars is said to be in opposition when it is on the opposite side of the Earth from the Sun. A line drawn from the Sun to Mars would pass through the Earth. Mars is said to be in conjunction when it is on the opposite side of the Sun from the Earth. A line drawn from the Earth to Mars would pass through the Sun.
One might think the best way to get to Mars would be to wait until near-opposition, when the planets are closest, and send our rocket directly there while the path is shortest. The problem with this is that a rocket leaving the Earth’s surface is moving the same speed around the Sun as the Earth: 30 km/s. Mars is moving 24 km/s in its orbit. We can’t just “lead” Mars a bit in our trajectory, the way you would shoot in front of the plastic duck in an arcade. We have to slow the spacecraft down to Mars’ orbital speed. With our current rocket technology, the propellant requirements would be overwhelming. Indeed, we currently have no theoretical engine technology that would allow such a trajectory in the future.
Instead, we use the relative velocities of the two bodies to our favor. In 1925, a German scientist named Walter Hohmann calculated that the most energy-efficient trajectory between two orbiting bodies is to follow half of an elliptical orbit that touches the orbit of the planet from which the craft is departing on one end and the orbit of the planet to which the craft is traveling on the other. Considering the relative motions of the two planets, this means departing the source planet when the destination planet is near opposition and arriving at the destination planet when it is near conjunction. You can see a nice demonstration of this at (https://www.jpl.nasa.gov/edu/images/activities/launch_window.gif) courtesy of JPL. This elliptical orbit around the Sun is called a Hohmann Transfer Orbit and it is into this orbit that SpaceX intends to launch a fancy red sports car. Without performing an orbital insertion maneuver at Mars, which, as I said at the beginning, is not possible for SpaceX, particularly since Mars will not be there when the Tesla touches its orbit, the Tesla will continue along its elliptical orbit indefinitely.
Frivolousness of the payload aside, this is an important step. No commercial venture has ever thrown a payload beyond Earth orbit. That has so far been the province of government agencies. No government agency has thrown a payload into solar orbit as cheaply as SpaceX hopes to. If we are ever to colonize Mars, transit costs have to come down dramatically. This is the problem SpaceX is tackling. The sports car just makes it a little more fun.