Oscillations and waves

Why can a diffraction grating separate nearby wavelengths more effectively when it has more illuminated lines?