The thin layer of the Earth's surface where living things are able to survive
is called the biosphere. It is about 20km thick, from the bottom of the
oceans high up into the atmosphere. Physical conditions outside the biosphere
are too extreme to support life. Ecosystems are discrete, recognisable,
self-sustaining units within the biosphere, such as woodlands, ponds, salt marshes
and rocky shores. Every ecosystem has a living (biotic) component, i.e.
the organisms that live there, and a non-living (abiotic) component,
i.e. the physical conditions in which an organisms live, such as landscape,
climate and type of soil. Specific and readily quantifiable abiotic factors
might include temperature, pH, humidity, wind direction, water current, light
quality, nutrients, pollutants, salinity, slope, aspect and altitude. An organisms
environment refers to the complete range of conditions in the ecosystem
which affect its way of life, not only abiotic factors but biological factors
such as competition for food, space and shelter. The study of how living organisms
interact with each other and with their environment is called ecology.

Although ecosystems are relatively self-contained and perpetuate themselves
by the cycling of minerals, they are not completely closed as if surrounded
by an invisible box. There is some movement of energy and materials between
them. All the energy entering an ecosystem ultimately comes from the sun; sediment
is eroded from hills, transported by streams and deposited in ponds; animals
may enter and leave, perhaps on a large scale (e.g. migratory birds, butterflies
and fish) or on a smaller scale (e.g. a woodpigeon flying from a wood to feed
in a meadow). However, this two-way traffic between ecosystems is limited because
animals are usually adapted to the particular conditions of only one ecosystem.
Sometimes the natural boundaries between ecosystems overlap or are hard to define,
such as those between rivers, estuaries and the sea.

The specific place where an organism lives is called its habitat. Habitats
may exist on a range of scales: woodland is a habitat for spotted woodpeckers;
an individual tree may provide the habitat for certain mosses, bark beetles;
individual leaves provide a habitat for leaf miners, although at this small
scale we might call it a microhabitat. The body of a host animal or plant
provides a habitat for an internal parasite.