Certain materials produce an electric charge (voltage) when they are squeezed or pressed. This is called "piezoelectricity." The effect also works in reverse: whenever an electric charge is applied to these materials, they will change their shape slightly in response. It works much like a common sponge, which expands as it absorbs water. When it is squeezed, water flows out.
The same thing happens with piezoelectric materials, only they absorb and produce electricity. That's why they are useful for lots of everyday applications. They were first used in sonar systems to detect submarines underwater. Sound waves bend the piezoelectric material, creating a changing electric voltage Today piezoelectric components can be found in microphones, in filters for radio and television, in the cigarette lighters in cars, and even as car sensors that can tell the driver how far away the rear end of the vehicle is from any objects in its path.
Piezoelectric materials are just one type of a class of substances known as "smart materials." There are substances that change their shape in response to a magnetic field, and others that are highly sensitive to light. The latter are called "photochromatic materials," and they are used in sunglasses, because they darken when hit with direct sunlight. Yet another type of smart materials are "electrochromic": they darken or change color in response to electricity, which in turn changes the way they reflect or absorb light. They are used in the new "smart window" technology. Turning on electricity in a smart window causes it to darken and block out light; turning off the electricity will cause them to become transparent again.