According to the competitive exclusion principle, also known as Gause's Law, if two species occupy the same niche, they inevitably compete for the dominance of this niche until one of them brings about the extinction of the other. In real life situations, it is common for one competitor to be at a disadvantage in terms of securing control of the ecological niche and for that competitor to diverge and adopt a new niche.
When two species that occupy the same niche eliminate some of the need to compete by diverging their niches they become able to exist simultaneously. Species can adapt to new niches by seeking out a different source of food or by altering their primary place of habitation. According to the Lotka-Volterra equation, competition within each species comes to predominate over competition between the two different species as their two niches diverge. There are many factors influencing how much niche differentiation is required in order to permit two species to coexist in overlapping niches. Some of them include how similar the two species are, how much variation there is within each species, what type of environment they are occupying and what type of resources they are competing for.