Carrying capacity in ecology refers to the maximum population size of a species that a specific environment can sustain indefinitely. It is determined by factors such as the availability of resources, competition, predation, disease, and other environmental limitations. When a population exceeds its carrying capacity, it can lead to resource depletion, increased competition, and ultimately a decline in population size due to unsustainable conditions. Maintaining a balance between a population size and the carrying capacity of its environment is crucial for the long-term survival of a species in an ecosystem.