The ecological niche of a species can be defined as the range of resources and conditions that allow the species to maintain a viable population. Theoretically, if two species have the same niche, one species will exclude the other. As a result, the niches of coexisting species must differ. Coexisting species niches may be similar but not identical. Such “niche partitioning” has been demonstrated in many aquatic organisms. Examples of niche division of fish species. For example, sunfish (family Centrarchidae) prefer to feed in pond habitat (e.g., coastal vegetation or open water), where they gain the most energy per unit force. However, habitat preference (hence niche occupancy) depends on the presence of other competitors; A species may have a wide niche in the absence of competitors, but a narrow niche in the presence of a competitor. In addition, the niche of a species often varies predictably with age (size). These “ontogenetic niche changes” are, as already mentioned, often driven by changes in diet.
Within a species, small individuals may have a different food niche than larger individuals, and diet is often associated with habitat preference. For example, small fish may feed on zooplankton in open water, while larger fish may feed on benthic invertebrates near the coast. As already mentioned, the strength and outcome of interspecific competition may depend on the size structure (age) of populations. Therefore, the breeding size of a species may depend on the presence or absence of a competing species and the size distribution of competing species. In addition, habitat selection is also strongly influenced by predation. In the absence of predators, small individuals can forage where the rate of food intake is optimal. In the presence of a predator, these individuals can feed if the risk of predators is lower. The ecological niche of a species has been defined by the resources it needs and by its role or function in the environment. The concept of ecological niche, when introduced by Grinnell (1917), focused on the habitat needs of a species for it to survive and reproduce. Hutchinson (1959) broadened this definition of niche by breaking down habitat into various resources that it embodied. The physical space that a species occupies, the temperature and humidity conditions of the room and the seasonality in abiotic and biotic conditions that the space undergoes, as well as the food needs and interactions that a species undertakes with other species are taken into account.
Here, the niche of a species can be graphically thought of as an n-dimensional hypervolume, in which each resource represents an independent axis (Figure 1). The space each species occupies in this hypervolume is defined by its basic resource needs (i.e., the fundamental niche) and reduced by antagonistic interactions with other organisms (i.e., realized niche). Schoener (1974) presented an analysis of resource requirements for several species of different taxa and showed that the main niche axes are food, habitat use and time. An early study of ecological niches led by Joseph H. Connell analysed the environmental factors limiting the range of a barnacle (Chthamalus stellatus) on the Scottish island of Cumbrae.  In his experiments, Connell described the dominant characteristics of C. stellatus niches and provided explanations for their distribution in the intertidal zone of the island`s rocky coast. Connell described that the upper range of C. stellatus is limited by the barnacle`s ability to resist dehydration at low tide.
The lower part of the range was limited by interspecific interactions, namely competition with a cohabiting barnacle species and snail predation.  By eliminating competing B. balanoids, Connell showed that C. stellatus was able to extend the lower bound of its realized niche without competitive exclusion. These experiments show how biotic and abiotic factors limit the spread of an organism. An organism free from disturbance by other species could use the full range of conditions (biotic and abiotic) and resources in which it could survive and reproduce, known as its basic niche.  Due to pressure and interactions with other organisms (e.g., .