How does a strain gauge work?

The metal foil is a resistor---it conducts electricity but also resists its flow somewhat. When the sheet is bent one way it stretches the foil slightly, making it longer and thinner. This raises its resistance, since the electricity has further to go and a more constricted path to follow. On the other hand, when the sheet is bent in the other direction it compresses the foil, making it shorter and wider and lowering the resistance. Because the foil strip is so long, even slight strains will cause fairly big changes in the resistance, which will be picked up by the Wheatstone bridge.