News coverage of the shortage of butter on French supermarket shelves (BBC, Bloomberg, NYT) is an economics lesson in itself.
As usual, when there's a "shortage," some sort of government intervention in the free market is nearby: the end of "milk quotas" in the European Union in 2015. I can see someone arguing that the cause of the shortage wasn't the quotas but the repeal of them, but that seems like a stretch.
There's also a good illustration here of how constantly adjusting prices helps allocate goods to where they are needed. The BBC explains the problem:
rigidities in France's system of pricing and distribution.
In other countries like Germany, supermarkets have responded to the changing world butter market by putting up [this is British English for "raising" -- ed.] their prices. In France, the cost to the shopper of a pack of butter has barely changed.
This is because butter prices are set annually in France, in negotiations between supermarkets and producers. The next round of talks is not due until February, so until then the supermarkets are only offering to pay what was agreed nine months ago - when butter was much cheaper.
French producers are not foolish. They can see that the world market is much more attractive than the domestic market. So they are saying "non" to the supermarkets, and selling their stock abroad.