Sunlight is necessary for photosynthesis. When the amount of sunlight is limited, some photosynthetic organisms cannot grow and flourish. As a result, other organisms that rely on these primary producers cannot flourish. Biodiversity decreases in this case.
Other abotic factors such as soil mineral and nutrient density, availability of water, temperature, humidity and others effect biodiversity in similar ways. Many organisms for example cannot sustain extreme heat or extreme cold. Biodiversity in these conditions is low. The most biodiversity conditions found on Earth are near the equator where there is an abundance of sunlight, temperatures do not fluctuates to extremes, there is an abundance of water and higher humidity. Distance from the equator often results in lower biodiversity.