The make-up of a community depends on abiotic factors (non-living) and biotic factors (living). Abiotic factors include temperature, light intensity, moisture level and the pH of the soil. Biotic factors include predators, the availability of food, competition and disease.
Abiotic factors set which species can live in an area. More light means more photosynthesis, so more plants can grow, and that gives more food for herbivores. A habitat with a low moisture level supports fewer species because only well adapted organisms, such as cacti, survive. Soil pH matters too: if the soil becomes too acidic for a plant species, its population falls, and the number of animals that feed on it also falls. Very low temperatures limit growth and reduce the number of species.
Biotic factors link the populations in a community. If the number of predators rises, the number of prey falls. Then the predators themselves decline because their food supply has dropped. More food allows an animal population to grow. Organisms in a community depend on each other, so we say they are interdependent, and a change in one factor can affect many species.