How does diffraction occur in diffraction grating?