Most ecosystems have some sort of base on which they rest -- usually made up of solid material like soil, rocks and minerals. These raw materials provide nutrients and shelter for organisms like plants and small animals. It also provides a place for decaying organisms to decompose and rejoin the ecosystem.
The types of material that can survive in an ecosystem will vary depending on the quality of water and how much water is available. All living things need water to carry out biological processes. Plants need water for photosynthesis; animals need water to digest food and access its stored energy.
If there is a lot of clean water, larger plants and animals can thrive there in larger numbers. The more water that is available in an ecosystem, the more diverse the life that can exist in that ecosystem. For example, rain forests, which have an abundance of water, have the most diverse ecosystems on the planet. Deserts, which have water shortages, is the least diverse.
The sun is a powerful component of an ecosystem. The sun provides both warmth and light for photosynthesis. The amount and duration of sunlight determines what kind of plants and animals can thrive in a given ecosystem.
In desert areas where there is a lot of sun, cacti have evolved to be able to handle it. Mosses and ferns, however, which thrive in shadier, cooler areas, can only grow in forest areas where there is more shade.
At the top of the food chain in an ecosystem are the plants and animals that live there. These large and complex organisms rely on all the other parts of the ecosystem to survive. They in turn, provide nutrients to the soil when they die and their bodies decompose.