While many species may share a habitat, this is not true of a niche. Each plant and animal species is a member of a community. The niche describes the species' role or function within this community. For example, the red fox's habitat might include forest edges, meadows and the bank of a river. The niche of the red fox is that of a predator which feeds on the small mammals, amphibians, insects, and fruit found in this habitat.
Red foxes are active at night.
They provides blood for blackflies and mosquitoes, and are host to numerous diseases. The scraps, or carrion, left behind after a fox's meal provide food for many small scavengers and decomposers. This then is the ecological niche of the red fox. Only the red fox occupies this niche in the meadow-forest edge communities. In other plant communities different species of animal may occupy a similar niche to that of the red fox.