When mechanical pressure is applied to a piezoelectric material, it causes a deformation in the crystal lattice structure. This deformation disrupts the balance of electrical charges, resulting in an electric dipole moment. Consequently, an electrical voltage is generated and can be harnessed for various applications.