The characteristic of converting mechanical energy to electrical energy, and from electric energy to mechanical energy is called piezoelectric. In other words, piezoelectric materials will expand or contract when subjected to a voltage, and generate a voltage when subjected to a pressure.
Generally, ceramics are comprised of fine crystals. Each crystal is comprised of atoms with a positive or negative electrical charge. Most ceramics have well balanced positive and negative electric charges. However, some dielectric ceramics called "ferroelectrics" have unbalanced positive and negative electric charges in the crystals, even under natural conditions, resulting in biased electric charges (spontaneous polarization).