Why does an animal defend its territory?

An animal will defend its territory to protect its resources. Two important resources for animals are food sources and suitable mates. If an animal wants to eat and breed it must defend these limited resources from rivals because, like any habitat, a territory has a carrying capacity : a maximum number of animals that can be supported by the habitat.