The French lost Alsace-Lorraine thanks to Otto von Bismarck's amazing diplomacy strategy called realpolitik. This was during a time when germany was comprised of over 300 city-states that were later consolidated into 39 independent nations who lacked a central government and a will to work together(you know how princes can be so selfish). The reason why the "Germany" was in pieces was because Napoleon did not want Germany to ever be able to challenge France again. After the fall of Napoleon I, the second time, Clemens Wenzel von Metternich of Austria(who charged a toll when the French were coming back from their defeat in Russia after losing hundreds of thousands of men and i believe he required that the French pay 1/3 of their treasury) realized that the Germanic nations needed to be strong enough to be an efficient buffer in case France got big again, which we know never happened, so he reduced the 300 cities down to 39 nations during the Congress of Vienna. He also made a law that stated the 39 Germanic nations could in not join together in any way in order to avoid aggression towards France out of revenge.
Bismarck would taunt other countries, that he knew Prussia could beat in battle, until their people got so mad that they would threaten their crown to fight or get overthrown. He used this tactic on Denmark, Austria, and France.
Germany gained Schleswig from Denmark(Austria got Holstein), recognition and Holstein from Austria, and from France, Alsace-Lorraine and a solidified German Empire.
The only reason why France got Alsace-Lorraine back was because someone had the bright idea to let France, who got completely embarrassed by the Germans, write the Treaty of Versailles. In this treaty France took back Alsace-Lorraine and made Germany pay a 1 billion Mark indemnity to France, which went completely against Woodrow Wilson's 14 points who said that Germany should not be harshly punished because it would incite the need for revenge. Therefore i think that France deserved to get spanked one more time by Germany in WWII.