High-performance piezoelectrics benefit transducers and sensors in a variety of electromechanical applications. The materials with the highest piezoelectric charge coefficients d33 are relaxor-PbTiO3 solid solution systems. A key signature of relaxor-ferroelectric solid solutions is the presence of polar nanoregions that coexist with normal ferroelectric domains. We recently quantitatively determine the contribution of polar nanoregions to the dielectric/piezoelectric responses of relaxor-ferroelectric crystals using a combination of cryogenic experiments and phase-field simulations. Guided by the phase-field simulations, we propose a mesoscale mechanism for the origin of the high piezoelectricity in relaxor ferroelectrics, emphasizing the critical role of local structure in the macroscopic properties of ferroelectric materials. Based on this mechanism, we employ a small amount of rare-earth dopants (e.g., Sm) to judiciously introduce local structural heterogeneity in Pb(Mg1/3Nb2/3)O3-PbTiO3 (PMN-PT) ceramics and achieve ultrahigh piezoelectric coefficients d33 of up to 1,500 pC/N and dielectric permittivity ε33/εo above 13,000 with a Curie temperature of 89oC, highest among ceramics. Very recently, the same strategy was employed in Sm-doped Sm-PMN-PT single crystals to achieve d33 values ranging from 3400 to 4100 pC/N, record-high among single crystals. Rare-earth doping is thus established as a general strategy for introducing local structural heterogeneity to enhance the piezoelectricity of relaxor ferroelectric crystals.