An ecosystem is all the organisms living in a habitat and the non-living parts of the habitat.
There are different levels of organisation in an ecosystem:
individual organisms
populations - groups of individuals of the same species
communities - made up of many populations living together
To survive and reproduce, organisms require certain resources from their habitat and the other living organisms there.
Trying to get enough of these resources results in competition.
Plants in a community or habitat often compete with each other for light, water, space and mineral ions from the soil.
Animals often compete with each other for food, mates and territory.
As well as competing with each other, species also rely on each other for food, shelter, pollination, seed dispersal, etc. This is called interdependence.
Because of interdependence, removing one species from a habitat can affect the whole community.
In a stable community, all the species and environmental factors are in balance so that population sizes stay fairly constant.
Tropical rainforests and ancient oak woodlands are examples of stable communities.