The concept of monster infighting was originally popularized by Doom. Before that, in games such as Wolfenstein 3-D, enemies only ever tried to kill the player(s), either ceasing their fire if another enemy stood between them and the player, or ignoring them totally, with the game's engine allowing their attacks to pass through the other enemy harmlessly.
In Doom, however, the various monsters' attacks could and did affect each other. When an enemy stood between another enemy and the player, the blocked enemy would open fire anyway, damaging the monster in its path, and the volatile nature of the demonic enemies in the game meant that they would immediately turn on each other under such circumstances, to the point of ignoring the player and focusing their attention on murdering each other. It was a common tactic for players to try to get powerful enemies to wipe out weaker enemies by positioning the weak monsters in between themselves and the more powerful foes, or to get monsters of similar strength levels to deal with each other while the player killed whoever won. Any two monsters, even monsters of the same type, could turn on each other if provoked in this manner. Notably, it was possible for friendly fire to cause the Pain Elemental monster from Doom II: Hell on Earth to become hostile to another monster, but the Pain Elemental lacks any real attack, instead only being able to spawn Lost Souls, which always enter the world only hostile against the player, so the sum total of a Pain Elemental's hostility towards another monster would be to turn towards them and spawn Lost Souls in their direction... whereupon the Lost Souls would ignore their 'mother's' opponent and go after the player. The "Gotcha!" bonus level in Doom II almost immediately presented the player with a room containing the two most powerful monsters in the game, a Cyberdemon and a Spider Mastermind, and it is universally suggested in strategy guides and FAQs to get them to fight each other, so that they will ignore the player, ultimately killing one of them (usually the Spider Mastermind, which has less health) and leaving the other with a fraction of its total health.
More recent games have developed a second kind of monster infighting, one determined by in-game factions rather than hostile personalities. For example, in Halo: Combat Evolved, the primary antagonists, the Covenant, will attack the player on sight because they are human, with whom they are at war. It is possible for Covenant enemies to accidentally injure each other, such as by a carelessly thrown plasma grenade or a badly aimed Wraith mortar, but, if they survived, they would shrug off the damage and ignore the friendly fire, continuing to attack the player or the NPC human soldiers, instead of turning on their Covenant allies. Similarly, the secondary antagonists, the Flood, will attack the player on sight because the Flood wish to infect all lifeforms with their parasite, and will not turn on each other if damaged by other Flood NPCs. But, when the Covenant and the Flood are in the same area, the Flood are just as hostile towards the Covenant as they are towards humanity, and will relentlessly attack either if encountered; similarly, the Covenant will attack the Flood on sight, understanding the threat they pose. There are several points in the game where it is more advisable for the player to hide and wait for one side to wipe out the other rather than running into the thick of things while the two sides are engaging each other. This "three-way-war" concept is repeated throughout the Halo series in a number of ways; usually repeating the Human/Covenant/Flood conflict, but changing things up occasionally. For example, near the end of Halo 2, during a civil war amongst the Covenant races, about half the species in the Covenant turn hostile towards the other half, most notably the animosity between the Elites and the Brutes descends into open war, with both sides remaining hostile towards the player.