The environment includes abiotic (nonliving) and biotic (living) factors. An ecosystem consists of all the biotic and abiotic factors in an area and their interactions. A niche refers to the role of a species in its ecosystem. A habitat is the physical environment in which a species lives and to which it is adapted.