A three-pile ending is when the game ends by emptying three Supply piles, rather than the Province (or Colony) pile. When this is done as an intentional, strategic move by a player, it is called three-piling.
A few cards, usually Alt-VP cards in rush games, play best when a three-pile ending is the goal, and there are many cards, including +Buy, gainers, and cursers, that can be very useful in achieving such an ending.
In games with more than four players, four empty Supply piles are required to end the game.
 Cards that like three-pile endings
Most counting Alt-VP cards:
Victory token cards that need to continue adding cards for fuel:
In order to achieve victory with a three-pile ending, you have to be sure that you have the most Harem and Island, are usually not enough to justify trying to empty out three Supply piles, though Distant Lands' 4 is often quite tempting. The counting Victory cards, like Gardens, are more likely to provide enough to viably compete with Provinces, but most need some sort of gaining enabler, like Workshop or Ironworks, in order to pump up their points. Bishop usually needs help trashing to merit three-piling, but in such Kingdoms it might be more worth it to go for a golden deck and just buy Provinces; Goons, on the other hand, usually needs the help of an engine so it can be played consistently, and in multiples, in order to produce enough to overwhelm any player foolish enough to only go for Provinces.. The most straightforward way to do that is by cheaply increasing your own points with Kingdom cards. Alt-VP cards that give static , like
The second necessary part to three-piling is the actual means to emptying Supply piles. The most obvious way to do that is through +Buy or gainers, though some are better than others. Cheap, preferably non-terminal +Buy, like Candlestick Maker or Market Square, works well, as do gainers that are either cheap, like Workshop, or otherwise useful, like Ironworks. Both of these groups do well emptying out their own piles; including the Alt-VP card in question, that just leaves one Supply pile left to empty, usually the Estates or Duchies. Curser games often lead naturally to three-piling, as the Curse pile usually quickly empties.
While Alt-VP rushes are most commonly associated with three-piling, engines can often end up three-piling as well. Engine players will often try to gain as many engine parts as possible, usually contesting certain piles in mirror matches, such as Fishing Village, Grand Market, and Laboratory. With +Buy and cheap engine parts, more than one pile can empty without either player gaining a single Victory card. Such games will often end with one player buying one Province or Colony, and then finishing off a third Supply pile, squeaking a win. City is notorious for this, as it requires two Supply piles to be empty in order to give its full effect in the first place. This can be frustrating when a player is trying to build their engine toward a hard to get card, such as Teacher or Prince, and the game ends before they can even make use of it.
A few cards are exceptionally good at emptying piles. Border Village, Stonemason, and Messenger all gain either on-gain or on-buy; since you can buy a card once every turn, but can only play a card once every shuffle (usually), these cards usually empty piles faster than conventional gainers. Masterpiece is an interesting case; the only pile it can empty is the Silver pile, and so works beautifully with Feodum, but is less useful with the other counting Victory cards.