For Spontaneous Polarization
In Fig. 8.1, the left shows the ideal wurtzite structure where all bonds have the same length and bond angles are equal. Therefore, Psp = 0. The right shows the
Fig. 8.1. The schematic diagram for the production of spontaneous polarization.
Fig. 8.2. The schematic diagram for the strain production in the AlGaN/GaN interface.
polar materials such as GaN and AlN crystals where exist asymmetric lattice structure and ionicity of the bonds. The bond along the c-axis is longer than the other bonds and the bond angles deviate from the ideal values. Therefore, the spontaneous polarization happens.
For Piezoelectric Polarization
Assuming the AlGaN/GaN heterostructures are grown along the  axis and GaN layer is thick enough, there will be tensile strain at the interface due to the lattice constant of AlGaN being less than that of GaN, as shown in Fig. 8.2.
Fig. 8.3. The schematic diagram for the piezoelectric polarization production at the AlGaN/GaN interface.
Fig. 8.4. Polarization-induced bound sheet charge, piezoelectric and spontaneous polarization of pseudomorphic AlGaN/GaN heterostructures with Ga-face polarity.
The bond lengths and angles are changed due to the strain which will result in the piezoelectric polarization, as shown in Fig. 8.3. The direction of the piezoelectric polarization will be along  for the tensile strain, which is kept consistent with the spontaneous polarization direction.