From ecosystems we derive food and fiber, fuel and pharmaceuticals. Ecosystems mediate local and regional climates, stabilize soils, purify water, and in general provide a nearly endless list of services essential to life as we know it. To understand how to manage these services it is essential to understand how ecological communities are organized and how to measure the biological diversity they contain. Ecological communities are comprised of many species, which are in turn made up of large numbers of individuals, each with their own separate ecological and evolutionary agendas. Not all species are equal as regards their role in maintaining the functioning of ecosystems or their resiliency in the face of stress. This chapter explains how ecosystems evolve and function as complex adaptive systems. It examines ecological systems at scales from the small to the large, from the individual to the collective to the community, from the leaf to the plant to the biosphere (including the global carbon cycle). It reviews theoretical and empirical models of ecosystem dynamics, which are highly nonlinear and contain the potential for qualitative and irreversible shifts. It considers applications to forests, fisheries, grasslands, and freshwater lakes.