Here’s a really condensed explanation:
Maxwell combined four equations for electromagnetism, corrected one by adding a missing term, and showed that they give rise to a wave equation for electromagnetic waves propagating at 300,000 km/s. Which just so happens to be the speed of light. Hence, he concluded that light is a wave, and its speed is what’s predicted by Maxwell’s equations.
But that raises the question: in what frame of reference do Maxwell’s equations apply? See, it was well understood at the time that speeds look different to different observers. If I throw a baseball at 60 miles per hour, it’s moving at 60 mph relative to me, but if someone drives by me in a car going 60 mph (in the same direction as the baseball), the ball will appear to be standing still. And who’s to say my frame of reference is right and theirs is wrong? After all, I’m standing on the Earth, which is rotating and orbiting the sun, so really I’m no more “standing still” than they are. (This last sentence is just a way of convincing students that there isn’t one “truly motionless” frame – as noted by other posters, this didn’t play a role in convincing Einstein of the principle of relativity.)
At any rate, this raises questions because Maxwell’s equations gave one specific number for the speed of light (the aforementioned 300,000 km/s), which was calculated from other empirically determined fundamental constants. But if speeds are different in different reference frames, one has to ask: in which reference frame do Maxwell’s equations apply? People originially thought it was the reference frame of the aether, some hypothetical invisible substance that provides the medium through which light traveled. But if that’s the case, we should be able to measure different values for the speed of light depending on how we’re moving relative to the aether. All the experimental attempts to detect this effect failed – i.e., they always measured the same speed for the speed of light.
Einstein’s answer to this came in 1905, when he proposed the postulate that the laws of physics, including Maxwell’s equations are the same in all inertial reference frames. (An inertial reference frame is one that is not accelerated – I’ll mention non-inertial frames in a bit.) Einstein’s second postulate follows from the first. If Maxwell’s equations are applicable in all inertial frames, then the speed of light must also be the same in all inertial frames, even though those frames of reference are moving relative to each other.
This simple idea had far reaching consequences. Before, we had a picture of the world in which observers in relative motion agreed on the lengths of objects and the lengths of time between events, but disagreed on the speeds of objects. Now, we have a picture where observers moving relative to each other agree on certain speeds (i.e., the speeds of electromagnetic waves), and as a consequence, they have to disagree about the lengths of objects and the amount of time that passes between two events. (There are various clever thought experiments that demonstrate this, but like I said, I’m trying to keep this short.) And because quantities like length and duration now depend on one’s frame of reference, the same turns out to be true for other related quantities like energy and momentum. However, it should be noted that when the relative differences in speed between the observers are at ordinary every-day values (i.e., much, much less than the speed of light), these differences are so tiny that we never notice them, and classical pre-Einsteinian physics is still a sufficiently good approximation for dealing with those cases.
Einstein followed up this paper with another one which examined what happens when a particle emits light. Specifically, he dealt with the case where a particle emits two identical light waves in opposite directions. In this case, the particle’s speed won’t change as a result of emitting the light (just as if I simultaneously fired two perfectly aligned identical guns in opposite directions – the recoil forces exactly cancel out). So, since the particle was initially at rest in its own reference frame, it stays at rest. Einstein compared this to another reference frame, one which was moving relative to the particle. In that frame, the particle moved with a constant velocity, since again the emission of equal quantities of light in opposite directions doesn’t change the speed of the particle.
The interesting physics showed up because the energy of the light being emitted was different for the two reference frames, as a consequence of Einstein’s theory of relativity. Einstein looked at the energy difference between the two frames, which represented the kinetic energy of the particle. (In the rest frame of the particle, it had internal energy only. In the moving frame, it had the same internal energy, plus some kinetic energy. So the difference was kinetic energy alone.) But because the light carried away different amounts of energy in the two frames, the energy difference between frames – the kinetic energy – changed. Since kinetic energy depends only on mass and speed, and the speed of the particle hadn’t changed, Einstein conluded that its mass must have changed, and in fact he found this change was equal to the energy of the emitted light times the square of the speed at which the light traveled. Thus, Einstein concluded that mass was proportional to energy content, and furthermore that mass could be converted into electromagnetic energy. The entire internal (non-kinetic) energy content of a particle of mass m was thus given by E = mc[sup]2[/sup], where c is the speed of light.
Although this equation deals with the rest-energy of a particle, there is a version that gives its total energy, namely E[sup]2[/sup] = p[sup]2[/sup]c[sup]2[/sup] + m[sup]2[/sup]c[sup]4[/sup], where p is the momentum of the particle. For particles with zero mass (like photons, the particles of light) this simplifies to E = pc, and for particles with mass m and zero momentum, this simplifies to E = mc[sup]2[/sup].
Now, at this point Einstein’s theory of relativity dealt only with inertial (i.e., unaccelerated) frames of reference. Because it is specialized to these cases, this has become known as the Special Theory of Relativity. In subsequent years, Einstein developed the General Theory of Relativity, which deals with accelerated frames. It’s based on the basic idea that accelerations are indistinguishable from gravitational forces. I.e., if you’re in an elevator and it suddenly starts accelerating upward, there’s no experiment you can do to determine whether the elevator is accelerating upward or a gravitational field is being applied to produce a downward force. This theory had various consequences, such as predicting that spacetime curves around massive bodies and that light rays can be bent by gravitational forces.
So what does this all have to do with quantum mechanics? Not too much. But in the same year that Einstein wrote his paper on Special Relativity and the subsequent E=mc[sup]2[/sup] paper (which didn’t actually contain the famous equation, since Einstein’s notation differed from that used today), Einstein also wrote two other papers of distinct significance. It is because of this that 1905 has come to be known as Einstein’s Miracle Year, and its hundreth anniversary is being celebrated throughout the world.
One of Einstein’s 1905 papers explained a phenomenon known as Brownian motion. The explanation was based on the existence of atoms, and as a result Brownian motion came to be seen as evidence that atoms really exist. But the other paper Einstein wrote that year dealt with a phenomenon called the photoelectric effect (essentially, light stiking metals and causing them to emit sparks). Einstein explained the photoelectric effect using the principle that light could only be absorbed in certain discrete amounts. This prediction of particle-like behavior for light eventually lead to the wave-particle duality and other quantum mechanical ideas. A similar idea had been used by Max Planck a few years earlier to derive his black-body radiation law, but there is some reason to think that Planck saw this as merely a mathematical trick, whereas Einstein saw it as a feature of physical reality. For this reason, some feel that Einstein, and not Planck, should be regarded as the true father of quantum mechanics. In spite of this, Einstein never fully accepted the probabilistic, non-deterministic nature of quantum mechanics, believing instead that the theory was an incomplete description of reality.
Incidentally, Einstein’s Nobel Prize was awarded mainly for his paper on the photoelectric effect, not for special relativity. Apparently, this was because the Nobel committee didn’t consider the theory of relativity to be fully confirmed at the time. But it’s generally accepted that in 1905 alone Einstein produced three Nobel-worthy papers (photoelectric effect, special relativity, and brownian motion).