Diffraction occurs when acoustic waves are incident on periodic structures such as graded metasurfaces. While numerous interesting diffraction phenomena have been observed and demonstrated, the underlying mechanism of diffraction in these structures is often overlooked. Here we provide a generic explanation of diffraction in phase gradient acoustic metagratings and relate high-order diffractions to multiple reflections in the unit cells. As such, we reveal that the number of unit cells within the metagrating plays a dominant role in determining the diffraction patterns. It is also found that the integer parity of the metagrating leads to anomalous reflection and refraction with high efficiency. The theory is verified by numerical simulations and experiments on planar metagratings and provides a powerful mechanism to manipulate acoustic waves. We further extend the theory to cylindrical waveguides for the control of sound vortices via topological charge in azimuthal metagratings. The relevance of the theory in achieving asymmetric wave control and high absorption is also discussed and verified both numerically and experimentally.