The chemical process of photosynthesis in plants (and other photosynthetic organisms) converts carbon dioxide and water into glucose molecules. This fuels cellular respiration in the plants (and the animals that eat them), which gives them energy to fuel their daily life functions or be stored for growth, repair, and reproduction (matter).
In most food webs, plants (phytoplanton in the ocean), which are producers, form the foundation of food production which feeds all other organisms. As plants are consumed by animals (consumers) and those animals are, in turn, consumed by other animals, some of the energy is lost at every level. These are called trophic levels. Roughly only 10% of the energy consumed is transferred up to the next trophic level of a food web. This makes sense as you consider that each animal uses some energy to perform its daily physiological functions (respiration, muscle movement, etc.), some is stored for growth and repair, some is lost as waste, and much is lost as metabolic heat. Because of energy loss, the number of organisms (mass) supported in any ecosystem decreases as it moves up though a food web’s trophic levels, making it look more like an ecological or energy pyramid. In any ecosystem, because of this 10% rule, there are fewer and fewer consumers as you move up the energy pyramid until you reach the apex predators. At each level, energy and matter is conserved. This means that energy cannot be created or destroyed, but can be converted into different forms as it moves through a food web. When organisms compete for food and resources in an ecosystem, they are actually competing for the very energy and matter they need to live and so limits the number of organisms that are supported there.
Energy is not the only things cycling through food webs. If you look at diagrams of photosynthesis and cellular respiration, you can see how the molecules of carbon, hydrogen, oxygen, etc. found in carbon dioxide, water, glucose, etc. move through food webs, the soil, and the atmosphere as they are combined, broken down, and recombined in different ways. This recombination of atoms and molecules drives the carbon cycle on Earth, where carbon circulates between the atmosphere, biosphere, hydrosphere, and geosphere.
Test your knowledge with the Cycles of Matter and Energy Transfer in Ecosystems - Short Answer Quiz.