What affects carrying capacity?
Generally speaking, the environment.
In a more specific level, finite resources, etc.
There are several ways a carrying capacity can be affected. One of the main ways are the finite resources which would lead to the competition between the organisms that eat the same food. However, the organisms that have the most favorable traits are the ones that are able to survive (which is supported by the idea of natural selection).
Also there are predators which are (almost) always keeping the number of preys in balance. Although there might be some cases, with interventions, that ecosystems can become unbalanced leading to the extinction of certain species due to the lack of resources for them to survive.