Answer
A habitat is the natural setting in which an organism lives, whereas a niche is a role the organism plays within that ecosystem. Habitat is concerned with how the environment affects the organism, whereas niche is concerned with how the organism affects the environment.
Work Step by Step
Habitat and niche are closely related phrases with a fine line between them. A species' niche is the specialized role it plays in an ecosystem. Niche primarily indicates how a species contributes to the energy flow of the system, how it acquires energy and supplies it further in the system, for example, if the species is a producer or consumer, and so on. Habitat, on the other hand, is the actual location where a specific species lives and adapts to environmental conditions, such as mountains or grassland.