An ecosystem refers to the community of organisms living together in the same habitat along with the non-living environment. It is made up of biotic components (living organisms) like producers, consumers, and decomposers, as well as abiotic components (non-living factors). There are usually multiple habitats within a single ecosystem, and the primary energy source for all living things is sunlight.