In December 1848, Louis Napoleon, nephew of Napoleon Bonaparte, was elected president of the Second Republic. Most political leaders in Paris at the time considered him a lightweight--easily manipulated, not terribly bright or competent. Louis surprise the entire nation when, on December 2, 1851, he seized power in a coup d'etat and became dictator of France. Exactly one year later, he declared himself Napoleon III and set out to bring France back to its former glory on the Continent in the Second Empire.
On the surface, France under Napoleon III glittered; in terms of specifics, France was the symbol of success in many areas. During Napoleon III's reign, the French economy flourished due to high demand for French goods, a new banking system put France's financial house in order, and a massive program of public works turned Paris into the envy of the entire world. The city was completely redesigned and improved by Baron Georges Haussmann. Haussmann ripped into poor neighborhoods, replacing them with museums, apartments for the bourgeoisie, brownstones, architectural wonders, wide and straight boulevards, etcetera. Paris, previously the most radical and most volatile of European capitals, took a decidedly more conservative bend--policing was easier, the bourgeoisie pushed the workers into the surrounding suburbs, and the rich came in droves to the center.
In foreign policy, Napoleon III had some success and some horrible failures. As a victor in the Crimean War and a key supporter of Italian unification, Napoleon III made French foreign policy dominant (for a time) on the Continent. With Savoy and Nice back under the French fold, Napoleon III could boast an end to the encirclement imposed upon France after the defeat of his uncle. However, his involvement in Mexico was a fiasco. In 1861, Napoleon III sent a military force to that nation to pacify the Mexican countryside, setting up Austrian archduke Maximilian as emperor of Mexico. France, as Mexico's largest creditor, had the support of Mexico's conservative elite who opposed the liberal policies of the previous president in Mexico City. However, Maximilian suffered from a serious lack of popular support in Mexico; once Napoleon III withdrew his troops to fight in Europe, Maximilian fell to popular uprising and was executed in the summer of 1867. French prestige was damaged and public criticism threatened to bring down Napoleon III's regime.
The proximate cause of the demise of the Second Empire was France's defeat at the hands of Prussia in the Franco-Prussian War. After Prussia occupied Paris, Napoleon III fled, and Prussia set up an unstable republican government based on universal manhood suffrage and multiparty parliamentarianism.
To explain the success of the Second Empire, we must see Napoleon III as one of the first modern politicians, keenly aware of the role of public opinion and skillful in the management of information and outward appearances. Napoleon III began his public works project not simply to make Paris a livable place (a reasonable goal, considering how dirty and crime-ridden Paris had been beforehand), but also to show his public and the world how successful and wealthy France had become. He wanted Paris to be the center of world culture and politics not only because he was fiercely patriotic, but also because the effect such international prestige would have on his voting public would be necessary to the maintenance of his regime. Napoleon III mastered the art of the public appearance and the modern-day "photo-op" before such modern politics actually took hold in other places (such as the United States).
The rest of France's success, based primarily on the economic boom in Europe at the time, was not Napoleon III's doing, but we can attribute some credit to him for maintaining it in France. Years of stable, dictatorial rule in Paris brought international investment back into France, resulting in a period of sustained economic growth and a stable period of wages increasing faster than prices. The rich did get richer, but abject poverty in the cities diminished, as well. Granted, poverty remained (despite Napoleon III's original promise in the presidential election of 1848; however, no one could argue against the fact that the economy was improving and France was doing pretty well.