Note that this is a massively abridged series of events here. You're asking for summaries of 3 separate wars so they will be, ultimately, very loose summaries of reasons. If you want more depth on something just ask :)
The Franco-Prussian War was a case that proved all the superior rifles and infantry "quality" means nothing in the face of logistical superiority; that is, the Germans would raise almost 500,000 men by the time the French blundered their way past 250,000 during each of their mobilizations. The French basically just got battered and overwhelmed almost immediately as they could not resist the withering offensive tempo of the Germans who, flat out, were able to just put more men on the field quicker. Railroads won the day.
A little more detail though for the specifics: The "left" of the French army, under François Bazaine with the bulk of the army (approx 130,000 men), would suffer their first catastrophe at Mars-la-Tour. Despite outnumbering the Germans over 4:1 at the start of the battle and ~2:1 at the end he never actually pushed his advantage. It's noted especially for Friedrich von Bredow's charge which managed to sneak up on the French cavalry and guns and scatter them to the winds; thus causing panic in the French infantry and general defeat. After this they would, with greatly reduced numbers, retreat to be outnumbered and attrited further at Gravelotte and, despite losing 1 man for every 3 Germans, could just not hold on and had to withdraw further to Metz.
It would be at this point that about 100,000 Frenchmen (about half of the standing army at this point) would be totally encircled and Napoleon III would ride to their rescue with the remaining French forces. 120,000 men under his command would march out to lift the siege and, to really shorten things up here (because it's not really worth going into depth) they were getting hammered from all angles by German incursions against them (see the above logistical dominance). So they retreated to Sedan to rest up as it was a relatively fortified position and, well, they got encircled again. The entire French army at this point was encircled (100,000 would be taken prisoner at Sedan alone) and their king, Napoleon III, would be taken prisoner as Paris went up in flames in revolution (again).
So, in short again, the Germans just flat out got more men on the field more quickly. It really harkened to the beginning of 20th century warfare; that individual heroism and micro superiority of soldiery (see the casualty counts above for the distinct reality that the French were, overall, better trained and better equipped) means jack in the face of logistical prowess; wars were won by administrators and bureaucratic not soldiers in other words.
At this point the French would experience roughly 50 years of newfound stability and would, ultimately, not be alone as well. The biggest difference as you may now notice is that when France went to war as did Russia; Germany did, ultimately, have to allocate a non-negligible amount of forces in East Prussia to handle them; however it was very small and we can't take that as the "only" reason as they were little more than a holding force.
Why did the German advance not work nearly as well then? Well, mainly, because the scale went up massively. There wasn't one, or even two armies that had to be encircled; there was a continuous front that would eventually extend from midway through Belgium all the way down to Switzerland of French armies. Further the French were not stupid and learned from their mistakes in 1871; they learned that a rapid mobilization was necessary and boy did they bring the house. Despite having a significantly lower population, 50 million to 40 million if I recall off the top of my dome, and this time would not be taken off guard; they would have a standing army of 884,000 men to the German 880,000 men. However they had a fatal flaw which spoke to their population disparity; even more masterfully though the French were capable of matching the German 1.2 million reservists who beefed their army up to a staggering 2 million soldiers within a few days of wars declaration. Somehow, against all odds, the French went in with just as much as the Germans had in other words.
So, at least in terms of infantry, the French are even; but are outgunned in other ways. The Germans have a crapload of heavy artillery; 105mm, 150mm, 205mm, etc. This would crush through the initial lines along with, well, the Germans attacking where the French weren't looking Western Belgium while they pushed into the Ardennes). So the French would withdraw and withdraw some more but then something amazing becomes clear, which is also terrifying for the German officers on the ground, this isn't a retreat it is a withdraw -- there are too few prisoners, too few guns captured, too few bodies.
It was a methodical, strategic retreat. I don't know if the French high command knew the Germans were attempting the same sucker punch in some magical clairvoyance or if their plan just happened to align with the German OHL's sensibilities but that was the case. Helmuth von Moltke the Younger, wanting to live up to his fathers name, along with the remainder of the German OHL, were fascinated by creating their own "Cannae" like their fathers in 1871; encircling the entire French army was their sole focus and when they saw the French armies seemingly running with their tails behind their legs they got drunk on the kool-aid so to say. However, like I stated above, this was a totally different type of war; it wasn't two armies of ~120,000 that they had to hit one at a time in isolated events but six armies of ~120,000 they had to hit simultaneously across an enormous front.
Things began to wane but, as I said, the OHL was drinking the kool-aid. Turns out the Belgian and French resistance, while overstated in size, was not so overstated in effect. The Germans had little to no telephones and relied almost entirely on telegraph lines for instant communication or physical letters being handed by rider. This was in a modern offensive by the way in a modern war with 2 million soldiers operating simultaneously. Turns out a bunch of angry Belgians and Frenchmen cutting telegraph lines can kind of hinder an already shaky logistical foundation and, moreover, when the two Generals in the "hammer", Kluck and Bulow, don't like eachother very much actual communication issues strains them further. To quote a fantastic piece on this matter:
Anyway, as the German Army advanced through Belgium they erected telegraph lines to maintain communication with the rear, including Moltke. Telegraph lines were strung from a pole, much resembling a telephone pole, and stretched for miles across occupied Belgium. The occupied Belgians, angry at being occupied, would go out at night, climb the poles, and clip the telegraph wires. That was obviously annoying, and so the Germans changed how they ran their lines. Rather than string them up in the open, the Germans just placed the lines on the ground, and ran them through fields, farms, woods, everywhere they needed to pass through. This new process succeeded in preventing the old form of sabotage, but the lines up to another. While the humans largely stopped cutting the lines, patriotic and loyal Belgian field mice went to work on the wires, proudly giving their lives to defend their homeland. All joking aside, much like today, animals loved to chew on telegraph wires, and mice were responsible for damaging huge sections of the wires.
The strategic situation was, at this point, unwinnable for the Germans. Here is a map of the situation preceding the Marne, let me see if I can make some sense of it to you. The idea was to encircle the entire French army and/or seize Paris; no one really knew and it kept shifting from one to the other but ultimately the plan was encirclement as they felt Paris would be abandoned (it held no real strategic value) but sieging it would still take quite a few necessary weeks. So on went on the offensive. However the infamous gap would be created between Kluck's First Army and Bulow's Second Army; Kluck zigged while Bulow zagged. Kluck last second decided to be more aggressive in the Paris region and Bulow decided to be far more defensive, the more timid of the two. Bulow went East, Kluck went Northwest.
Between 1870 and 1914, the way men did war completely changed.
In 1870, you will find that Army Corps Organisation is very reminiscent of the organisation from the start of the 19th century (Napoleonic Wars). The improvement in the equipment used by both armies between 1805 and 1870 could be considered as incremental. Percussion caps for rifles were improved, canons and howitzer accuracy as well. But overall, military equipment hasn't been revolutionized.
This isn't the case for World War I however. Between 1870 and 1914, the Industrial Revolution occured. And countries had invested heavily into the "industrialisation of the war" as we cal it here in France (Industrialisation de la Guerre).
The improvement in military technology that occured during that period was huge :
-Long range, powerful and precise artillery was developped (105mm canon developped in 1913 for instance)
-Army Aviation ( Bi-planes or Tri-planes were used for scouting, bombing or even air combat, the most famous WWI aviator being the Red Baron)
-"Steel Navy" as we call it, with the development of destroyers, cruisers and even submarines, multiple times more resilient and powerful than the frigates both armies used 50 years before.
-Mechnanized armored vehicles (Landships and tanks)
Basically, the gap in technology between both wars is huge, making them hardly comparable.
During the Franco-Prussian War of 1870, Germany had a military force almost double the amount the french had at the start of the war (the gap wasn't as wide a few months after due to conscription). But overall, Germany had more men, more guns, and the same old strategy as in every war that opposed France to Germany : Capture Paris
France on the other hand, had failed to introduce army reforms in the years preceding the war. This caused a great toll on the equipment and active forces the French army could deploy in a war of such a scale. If you add the fact that Napoleon III, who had many things in common with Napoleon I, but not his military genius, took command himself of the French Army for the start of the war, well, France wasn't in the best of situations.
Without going too far into details, Germany crushed us thanks to an efficient use of its troops, strategy and tactics.
Now, as to the First World War, the conflict didn't merely oppose the French to the Germans but many other nations. Germany, Austria, Hungary and the Ottomon Empire against France, the United Kingdom, Russia, Belgium or the United States (from 1917 to 1918)
As such, the military forces that could be summoned were in the end, very similar, at least at the start of the war. However, the allied forces uncontestably suffered more defeats in the early stages of the war than the central powers.
It wasn't until the Battle of the Marne in September 1914 that the first real allied "victory" occured. From that point, the war changed from a war of movement (guerre de mouvement) to a war of positions (Guerre de positions/guerre de tranchées). The trench war pretty much put the belligerants of the war at a stalemate, and all the technology mentionned at the start of this post couldn't resolve the situation in a timely manner.
Tldr : France was unprepared and militarily underpowered in 1870 in comparision to Germany. Evolutions in weaponry that occured due to the Industrial Revolution caused a stalemate during WWI, thus making the "swift wars" of the past impossible.
(Disclaimer: I'm french, pardon me for the potential grammatical errors)
My answer isn't as comprehensive as that of /u/elos_ 's great answer, however I'd like to leverage that answer and bring up several points in relation to the Franco-Prussian War, WW1, WW2.
Franco-Prussian War.
In the lead up to the war, opinion as of who would have the advantage were varied, and changed with time. Up to 1866 the French army had significantly more "field experience", from the wars fought in Italy, Algeria, Crimea, and Mexico. The 400,000-strong French army had a core of regulars and conscripts who served for 7 years, there was no universal conscription. Its commanders had extensive experience in irregular warfare, and many have criticized in hindsight that this encouraged the system of mobilizing, advancing, and improvising. At the strategic level, there was no theater strategy in place when conflict broke out.
The Prussian army consisted to a large part of conscripts, and combined with her allies they amounted to 1,000,000 soldiers. In contrast to the French high command, Prussia relied heavily on the General Staff, who devised a strategic plan that informed a high level of detail for mobilization and movement. Unlike the French General Staff, the Prussians allowed their General Staff more independence and influence, rather than putting them in subordinate relation to field commanders. Further, the Prussians emphasized encirclement and destruction of enemy forces, along with detailed reconnaissance in the field.
When the Prussians annihilated Austria's army in 1866 in just seven weeks, heads turned and the French embarked on a reform program. Universal conscription was enacted with shorter service time. Tactics were revised, with the French emphasizing defensive positions to take advantage of their superior chassepot breech-loader, although they still had to use muzzle-loading cannons. They had the mitrailleuse volley gun, however the operators were disorganized and inexperienced; as a result they were fielded in very small numbers and they were ineffective. These disadvantages were evident in the first part of the war when an ill Napoleon III took command and wavered between defensive posturing and an offense. A pre-war plan called for an offensive, however when war broke out they decided to be on the defensive. Unfortunately, domestic pressure forced Napoleon III to take the first step anyway to Saarbucken, a very slow chaotic deployment that presaged the rest of the war. Even though they succeeded in taking Saarbucken, the ensuing withdrawal were hasty in parts, leaving significant parts of the French army exposed and unaware that the Prussians had strong presence nearby. Remember the comment about Prussian cavalry doing a better job at screening and reconnaissance? The French were spread out over 20 miles in order to reduce logistical pressure, uninformed, and unprepared.
All of these deficiencies combined to terrible effect on the French on many occasions, including at Mars-la-Tour where an entire French army was held up and defeated by two Prussian corps. French commander Bazaine was uninformed, indecisive, and never thought to use his 4-to-1 superiority to overrun the Prussians. Instead, the Prussians were able to run down French artillery.
Gravelotte was a very informative battle in that the French actually had a chance to deploy in a way that they wanted: with rifle pits set up, mitrailleuse overwatching. They succeeded in repelling the initial Prussian attack, however the Prussians concentrated their artillery to stabilize the line. The French succeeded in killing a large number of Prussian soldiers, but the Prussians earned the strategic victory of blocking French movement to Verdun.
First World War
What has been said about the French 75 and much superior mobilization compared to 1870 were very important. Keep in mind that the western theater of this war was fought almost entirely on French soil, in a heavily industrialized and populated region at that. This would have significant implications in French policy as we build up to ....
World War II
And for this, don't miss the excellent comments on this thread in relation to the Maginot Line and other French military tactics.
Closing comments
If we are to talk about French history, I think it is very informative to consider the entire period from French Revolution to WW2 as events strongly influence each other. So questions such as Franco-Prussian War, WW1, WW2, benefit from being considered holistically.
Can we FAQ this thread?