From TF2 Wiki
A Backstab is a context-sensitive attack with the Spy's Knife that results in a one-hit kill (unless the target is using the Dead Ringer, has the Razorback equipped, or is under the effects of an Übercharge). A Spy may backstab an enemy as long as the enemy is close enough to be hit with a melee attack, and as long as the Spy is within a 180° range of the enemy's back. To indicate that a Spy is within the required range to perform a backstab, his Knife will become primed, with its tip facing downwards. The Knife will remain in this position until the target is no longer in reach, or the Spy attempts a backstab by attacking.
A backstab can be performed while you are disguised, although your disguise will be removed upon attacking, regardless of whether the attack connects with the enemy or not.
A useful technique that can be employed by a skilled Spy is to sap an Engineer's Sentry gun and then immediately backstab the Engineer. As most Engineers will turn to face their Sentry gun to remove the Sapper, this gives the Spy an excellent opportunity to backstab his enemy. Trickier still is backstabbing the Engineer first, then quickly changing weapons to the Sapper and then sapping the Sentry before it is able to turn and fire (this will not work so well on higher levelled sentries, as their turning speed is faster).
The Sniper's unlockable Secondary weapon, the Razorback, prevents one backstab per life (unless the Sniper returns to a resupply cabinet) and stuns the offending Spy momentarily. This weapon makes Snipers less susceptible to backstabbings, and forces Spies to use other methods of attack.
Killing a player with a backstab will sometimes cause a special death animation for that class. This animation has a 25% chance of occuring.
Due to an in-game glitch, a backstab can sometimes occur upon stabbing an enemy in the front of their body, referred to by the community as a 'facestab'. While these problems have been reported to be fixed in the developer notes accompanying various patches, facestabs do still occur occasionally (this is most likely due to lag).
Another community-coined term, is the 'failstab', which refers to a backstab which should have succeeded but instead did only normal Knife damage, despite the backstab animation playing fully and the Knife connecting. Failstabs are often caused by lag compensation.
- Due to the nature of achieving a backstab, it is technically impossible to score a non critical backstab.
- Originally the Spy's backstab animation was just over a second long and manifested as the current animation but slowed down. This was changed to the current, sped up version we have today in the interests of balance.
- There are several community-devised specialist techniques when it comes to backstabbing, such as the aforementioned Stab'n'sap, or the Stairstab (which involves leading a target up a stairwell and jumping over them to stab them as they run up), both of which requiring some level of practice.
- Stairstab: Stand at the top of the stairs, facing down at an enemy approaching you. Run forward and jump, turning in mid-air to stab them in the back. This technique can be difficult to master, but it is also difficult to protect against, as the enemy has to turn almost completely around to avoid it.
- Spinstab: While an enemy is running towards you, let them run past you before spinning and stabbing their retreating back.
- Moving efficiently: Learn to utilize shortcuts and tricks of the map to catch up to faster-moving enemies such as Medics and Scouts.
- Teleports: As a disguised Spy, you can take the enemy Teleporter, making your disguise more believable and often placing you in a very advantageous position behind an Engineer in his Sentry nest.