Denying is a mechanic in Dota Allstars and Dota 2 that allows heroes to attack allied units on low health. It was originally an error in Dota Allstars that was carried over due to Warcraft III's engine. Denying allows a hero to kill their own creeps, halving the amount of experience gained by enemy heroes, and preventing them from last-hitting, further reducing income.
Denying can only be done by force attacking (A + Left click), and can be done on Allied creeps, structures and heroes. Creeps can be attacked when below 50% health, structures when below 10% health, and heroes when below 10% health and while under certain DoT effects (such as Venomancer's Poison Gale). An exclamation mark will appear above the head of a denied unit. In Dota 2, when a hero denies a creep, they have a chance to call out a message that differs slightly depending on the hero.
Some heroes are able to deny themselves by casting spells that cost health. Goblin Techies are able to deny themselves from full health with their Suicide Squad skill, which detonates themselves in order to deal massive damage in an area around them. Pudge is able to deny himself with Rot, which deals the same amount of damage to him as it does to enemies around him. Finally, Alchemist is able to deny himself by over-charging his Unstable Concoction, which deals damage and stuns himself if it is left alone for too long. Suicide halves the amount of exp gained by nearby enemy heroes, as well as halving respawn time and nullifying the gold loss due to death. Suicide also preserves the hero's kill streak.
Roshan and other Neutral creeps are also able to "deny" heroes if they get the last hit. The hero killed in this fashion does not gain any of the bonuses granted from Suicide when killed by a creep, but does not allow enemy heroes to get the last hit. It also retains the hero's Kill Streak.