From 1d4chan

A total party kill, almost always abbreviated to simply TPK, is roleplaying gamer slang for a event that results in the deaths of the entire adventuring party. It's unideal because it ends the game and everyone has to start over.

In a typical game, a TPK will occur due to a breakdown in communication between the GM and his players. Under a competent GM, this happens when the players are too retarded to back down from a threat which said GM has already hinted they're not ready for. (See Barbara Tuchman, The March of Folly, for examples in history.) On the other side of the table we have the phenomenon of That Guy, who sees the game as a competition between himself and his players; viewing TPK as a gold medal for himself.

Or, one or the other side could engineer the TPK because that side is fucking done with the game for whatever reason. Although (on the GM side) a "rocks fall, everyone dies" scenario could technically be a TPK, they are not usually described as such.

Some games are structured to raise up TPK for the lulz: Paranoia was big on this. Some are designed intrinsically to be harder on the players, like Dark Heresy. In games such as Call of Cthulhu, some campaigns seem to be designed to cause TPKs, leading to a strange influx of American PIs to whatever Mythos-ridden hellhole the party is unlucky enough to be exploring. These systems are for experienced GMs and players, who know what they're getting into.

Note that when the party in question is the total population of a planet, Imperial experts have created the term "exterminatus" to accurately describe the phenomenon. If playing a Dungeons & Dragons derivative, the best way to accomplish this is the infamous Deck of Many Things. Give it to your players, sit back and watch even the ones who should know better destroy themselves without having to lift a finger to do it yourself.