The size and make-up of a community is affected by abiotic factors, which are non-living, and biotic factors, which are living. Abiotic factors include temperature, light, water and pollutants.
Temperature affects how fast the chemical reactions in an organism run, because enzymes work best at a particular temperature. Organisms are adapted to the usual temperature of their habitat and may die if it changes too much. Light is needed by plants for photosynthesis. In a shaded wood, plants receive less light, so they make less glucose and grow less, and the animals that feed on them are affected too. Water is needed by all organisms. In dry habitats fewer species survive and plants may wilt. Pollutants such as sewage and chemicals from factories can poison organisms. Sewage lets bacteria multiply and use up the oxygen in a river, so fish die and the community changes.
Biotic factors include competition and predation. Organisms of different species, or of the same species, compete when a resource such as food, light or space is in short supply. A predator hunts and eats other animals, its prey. When the prey population rises, predators have more food, so the number of predators rises. More predators eat more prey, so the prey population falls. Then the predators have less food and their numbers fall too, and the pattern repeats.