After the Austro-Prussian war, Prussia was greatly enjoying its newfound prominence in continental European politics. Napoleon III, however, had been upset about the whole thing ever since the war ended. In fact, even though France hadn't actually been a part of the Austro-Prussian war in really any way at all, Napoleon got his diplomatic hand in at the end in an attempt to weaken his new rivals and managed to negotiate French possession of Luxembourg and a vague promise that maybe he could have Belgium if he played his cards right. In order to secure those concessions, such as they were, though, he had to deal with Otto von Bismarck, the famed Iron Chancellor of Prussia. Bismarck sold all the information he got from dealing with Napoleon to the south German states, his former foes in the Austro-Prussian war with whom he sought a new alliance, and whose numbers would be decisive in the coming French conflict. At this point, I think it's fair to say that Bismarck was probably a better statesman than Napoleon III.
The spark that really set the war in motion was the deposition of Queen Isabella II of Spain in 1868. While the Spanish were looking for a new ruler for their nation, they happened to mention the possibility of Prince Leopold of Hohenzollern-Sigmaringen, who had ties to the royal house of Prussia, maybe taking the throne. He was a bit reluctant to be the king of Spain, though, until Juan Prim, Spain's temporary leader, and Bismarck gave him a good talking to. After their wiles had been plied on the good Prince Leopold, he changed his mind and accepted the Spanish throne in June of 1870.
At this point, it might be beneficial to look at things from the French point of view. Prior to 1870, they had been eyeing Prussia warily, being understandably reluctant to allow a major military power with a demonstrated expansionist predisposition to develop on their eastern border. As of 1870, they were not only looking at that possibility but also the fact that their neighbor on the other side, Spain, would be essentially another Prussian territory if Leopold became king of Spain. For the French, this meant that they would be at a major strategic, diplomatic, and military disadvantage to Prussia if Leopold was chosen. The French exerted a bit of diplomatic muscle in Spain and managed to get Leopold's candidacy for the throne rescinded, but when the French ambassador, the duc de Grammont, spoke with King William I of Prussia, they did not exactly see eye to eye. The French wanted the Prussians to promise never to allow Prince Leopold to be a candidate for King of Spain, and the Prussians simply weren't having any part of it. William I sent a transcript of his interview with the French ambassador to Bismarck, who apparently "edited" it before publishing the message publicly on July 14. Whether the French felt misrepresented or whether they were mad about copyright infringement or whether Bismarck had simply inserted flatulence noises after everything the French said, I'm not sure, but for some reason this telegram, known as the Ems telegram, was enough to make them decide to go to war on July 19, 1870.
Actually, when I say "them," it's not quite accurate. The decision was actually made by one man, Napoleon III, as a bid to restore his waning popularity with the French people. His advisors had told him that the army of the powerful French Empire could easily whip the upstart Prussians, who had controlled a tiny chunk of territory in a relative backwater of Europe until fairly recently. The French had at least two advantages in the field of military technology whose importance were somewhat inflated by Napoleon's advisors: the mitrailleuse, an early type of machine gun that worked something like a Gatling gun, and the chassepot rifle, a breech-loading gun for their infantry.
The French really had little hope of winning the war relying solely on neat gadgets, though. The Prussians, headed by General Helmuth von Moltke, were less creative in their killing methods, but their lack of imagination in that arena was certainly made up for with their vastly superior logistical planning, their efficient and speedy troop mobilization, and the pure numerical superiority that came from Otto von Bismarck's alliance with the South German states. Within 18 days of the start of the war, Prussia had put 380,000 troops on the front lines. The French got there a bit late, though, and their supplies were lacking when they arrived. The French army was grouped into right and left wings, each of which had separate commanders. The left wing was commanded by Marshal Achille Bazaine and the right by Marshal Patrice MacMahon, who was also personally accompanied by the emperor Napoleon III himself. While in retrospect it might not have been such a good idea to have the head of state accompanying a forward army group, Napoleon probably thought that to appear as a conquering hero was the easiest way to give his image a facelift with the French public. This strategy, and pretty much everything France did during the war, backfired as soon as the first shot left its gun.
The French right wing was pushed back to the west starting on August 6, 1870. On the same day, the left wing was also pushed to the southwest after being flushed out of Saarbrucken by German forces. The entire left wing of the French army was forced to retreat to the fortress of Metz, where the Germans essentially made further retreat impossible by surrounding and besieging them after defeating them at the battles of Mars-la-Tour and Gravelotte on August 16 and 18. The French right wing tried its best to come to their rescue, but they failed miserably. They were encircled at the Battle of Sedan on August 31 and then held out for two days before the entire 83,000 man force, including the emperor himself, surrendered to the Germans. The entire French force that had been mobilized to destroy Prussian resistance was thus either contained or captured, with the head of state. By all rights, the French really should have given up at this point and started wearing a paper bag over their military head, since they had been trounced and humiliated about as much as any major military power in history, but they just didn't know when to quit.
When the French people heard about the capture of Napoleon III, they were none too sad about it. A provisional military government was set up and the Third Republic of France was declared, in essence saying that the Prussians could pretty much keep Napoleon's unpopular ass as far as the French were concerned. The Germans weren't going to let the issue drop just because of the total defeat and humiliation of their enemy, though, and they moved to besiege Paris itself starting on September 19. In an improbable military maneuver the likes of which only seem to happen in and around Paris (e.g., the Taxi-Cab Offensive of World War I), Leon Gambetta, a leading figure in the provisional government, piloted a hot-air balloon out of the besieged city in hopes of raising another army in the French countryside. He got his army, but it was simply too weak to defeat the Prussian siege forces, although it did put up a valiant effort. In the end, the 140,000 troops at Metz eventually got tired of being besieged and surrendered to the Germans on October 27. Paris itself did not surrender until January 28 of the next year, and the last French stronghold, Belfort in Alsace, held out until February 16.
An armistice was signed on February 26, 1871, and it established a French National Assembly that would be given the authority to conclude a real peace. Said peace was threatened by a group of radicals in Paris who rebelled and briefly established a government called the Paris Commune, but who were put down within about two months. The Treaty of Frankfurt, signed on May 10, 1871, concluded the war, although the bones of contention over which the next war would be fought were implicit in the peace settlement, as was the fashion of the day. Germany was allowed to annex Alsace, except Belfort, and half of Lorraine. They had also grown fairly attached to Metz, what with all the sieging going on in that neighborhood, so they took it, too. Although they had no particular attachment to five billion francs, they had no reservations about kicking a man while he was down, so they took that from France to cover the costs of punitively occupying north France until they got their five billion francs. Additionally, although it wasn't covered in the treaty, the Papal states that France had controlled and that Napoleon had had a particular interest in hanging on to were annexed by Italy upon Napoleon's capture and subsequent disowning by France.
The French Empire was soundly defeated and the German Empire was on its way to becoming a new superpower in Europe. Just to piss off the French, Bismarck had the King of Prussia, William I, proclaimed first German emperor at Versailles. France knew how to hold a grudge, as did Germany, and the two went to war over much the same sorts of things forty years later in World War I. No need to learn from your mistakes when you can just engulf Europe in death and mustard gas.
Sources: http://www.onwar.com/aced/chrono/c1800s/yr70/ffranceprussia1870.htm, http://www.encyclopedia.com/articles/04695.html