All animals are heterotrophs, meaning that they feed directly or indirectly on other living things. They are often further subdivided into groups such as carnivores, herbivores, omnivores, and parasites.
Predation is a biological interaction where a predator (a heterotroph that is hunting) feeds on its prey (the organism that is attacked). Predators may or may not kill their prey prior to feeding on them, but the act of predation almost always results in the death of the prey. The other main category of consumption is detritivory, the consumption of dead organic matter. It can at times be difficult to separate the two feeding behaviours, for example, where parasitic species prey on a host organism and then lay their eggs on it for their offspring to feed on its decaying corpse. Selective pressures imposed on one another has led to an evolutionary arms race between prey and predator, resulting in various antipredator adaptations.
Most animals indirectly use the energy of sunlight by eating plants or plant-eating animals. Most plants use light to convert inorganic molecules in their environment into carbohydrates, fats, proteins and other biomolecules, characteristically containing reduced carbon in the form of carbon-hydrogen bonds. Starting with carbon dioxide (CO2) and water (H2O), photosynthesis converts the energy of sunlight into chemical energy in the form of simple sugars (e.g., glucose), with the release of molecular oxygen. These sugars are then used as the building blocks for plant growth, including the production of other biomolecules. When an animal eats plants (or eats other animals which have eaten plants), the reduced carbon compounds in the food become a source of energy and building materials for the animal. They are either used directly to help the animal grow, or broken down, releasing stored solar energy, and giving the animal the energy required for motion.
Animals living close to hydrothermal vents and cold seeps on the ocean floor are not dependent on the energy of sunlight. Instead chemosyntheticarchaea and bacteria form the base of the food chain.