Diffraction occurs when light passes through a narrow slit because the edges of the slit cause the light waves to bend and spread out. When the width of the slit is comparable to the wavelength of the light, this bending becomes significant, and the light does not simply form a sharp shadow beyond the slit.
Instead, the light waves emerging from different parts of the slit interfere with each other. This interference produces a pattern of bright and dark regions on a screen placed behind the slit. The central region, called the central maximum, is the brightest and widest. On either side, there are alternating dark and bright fringes caused by destructive and constructive interference respectively.
The spreading of light and formation of these fringes is a clear demonstration of the wave nature of light. If the slit is very wide compared to the wavelength, diffraction effects become minimal, and light travels almost straight, forming a sharp image. But as the slit narrows, the diffraction and spreading become more pronounced.