thumb|upright=1.35|A food pyramid and a corresponding food web, demonstrating some of the simpler patterns in a food web

thumb|A graphic representation of energy transfer between trophic layers in an ecosystem

Energy flow is the flow of energy through living things within an ecosystem. All living organisms can be organized into producers and consumers, and those producers and consumers can further be organized into a food chain. Each of the levels within the food chain is a trophic level. Trophic dynamics relates to thermodynamics because it deals with the transfer and transformation of energy (originating externally from the sun via solar radiation) to and among organisms. Beginning with photosynthesis, water (blue) and carbon dioxide (white) from the air are taken in with solar energy (yellow), and are converted into plant energy (green). Producers are important because they convert energy from the sun into a storable and usable chemical form of energy, glucose, Some examples of primary producers are algae, mosses, and other plants such as grasses, trees, and shrubs. This process, referred to as chemosynthesis, usually occurs deep in the ocean at hydrothermal vents that produce heat and chemicals such as hydrogen, hydrogen sulfide and methane. Generally, 60% of the energy that enters the producer goes to the producer's own respiration.

thumb|Venus Flytrap

Carnivorous plants

When it comes to dealing with environments that have low nutrient availability, some plants have developed unique ways to adapt to be able to perform photosynthesis. In order to do so, these plants have evolved to be able to obtain important nutrients such as nitrogen from other organisms, just as heterotrophs would giving them the unique title of carnivorous plants. With methods such as the pitfall trap (pitcher plant), the flypaper trap (Drosera capensis), or the snap trap (venus flytrap) these plants have learned to lure insects in and digest them.

Pitcher plants lure insects in using a variety of attractive cues such as scent and color. Once an insect or small organism falls into the bulb shaped body of the plant, a variety of enzymes are secreted beginning the digestion process of the organism and preventing it from escaping. Flypaper trap plants, the most common of carnivorous plants, secret a special liquid that allow an insect to land on its leaves but then prevents the insect from escaping. The snap trap plant, use similar methods to the pitcher plant in order to attract various insects. However, these carnivorous plants are able to detect when an insect is touching its leaves thus triggering the "mouth" of the plant to close and encase the insect.

Secondary production

Secondary production is the use of energy stored in plants converted by consumers to their own biomass. Different ecosystems have different levels of consumers, all end with one top consumer. Most energy is stored in organic matter of plants, and as the consumers eat these plants they take up this energy. This energy in the herbivores and omnivores is then consumed by carnivores. There is also a large amount of energy that is in primary production and ends up being waste or litter, referred to as detritus. The detrital food chain includes a large amount of microbes, macroinvertebrates, meiofauna, fungi, and bacteria. These organisms are consumed by omnivores and carnivores and account for a large amount of secondary production. Secondary consumers can vary widely in how efficient they are in consuming. The efficiency of energy being passed on to consumers is estimated to be around 10%.

In terrestrial environments

Secondary production is often described in terms of trophic levels, and while this can be useful in explaining relationships it overemphasizes the rarer interactions. Consumers often feed at multiple trophic levels. Energy transferred above the third trophic level is relatively unimportant. While a portion of the energy is used for respiration, another portion of the energy goes towards biomass in the consumer.

Detritus is a large portion of organic material in ecosystems. Organic material in temperate forests is mostly made up of dead plants, approximately 62%. In addition, secondary production in streams can be influenced heavily by detritus that falls into the streams; production of benthic fauna biomass and abundance decreased an additional 47–50% during a study of litter removal and exclusion. The acting mechanisms within each pathway ultimately regulate community and trophic level structure within an ecosystem to varying degrees. Bottom-up controls involve mechanisms that are based on resource quality and availability, which control primary productivity and the subsequent flow of energy and biomass to higher trophic levels. For example, among aquatic ecosystems, higher rates of production are usually found in large rivers and shallow lakes than in deep lakes and clear headwater streams. Aquatic primary production is dominated by small, single-celled phytoplankton that are mostly composed of photosynthetic material, providing an efficient source of these nutrients for herbivores. Across ecosystems, there is a consistent association between herbivore growth and producer nutritional quality.]]Modeling of top-down controls on primary producers suggests that the greatest control on the flow of energy occurs when the size ratio of consumer to primary producer is the highest. The size distribution of organisms found within a single trophic level in aquatic systems is much narrower than that of terrestrial systems.