Spile

A spile (sometimes called a "cask peg") is a wooden or metal peg used to control the flow of air into, and carbon dioxide out of, a cask of ale or wine. Spiles can also be used to broach liquids (like maple syrup) from a tree.
Cask ale is dispensed without the addition of externally supplied gas. Properly conditioned cask ale will have enough dissolved carbon dioxide (produced by yeast) to have bubbles. In fact, the yeast can produce more carbon dioxide than is required, and it is for this reason that the cask is vented through the hole in the shive.
The cask is sealed when it is first connected to a beer engine. It has a keystone (where the beer tap will be driven in) and a shive (through which it was filled). Once it has been laid down for dispensing, a venting punch is used to pierce the shive, which is either partially pre-drilled or has a hardwood tutt sealing the completely drilled hole. This breaks the seal, and the tap can then be driven into the keystone.
To allow the loss of excess gas, a soft spile (made of open-grained softwood, bamboo, or harder wood with cuts in) is used. Once a cellarman judges this process to be complete, a hard spile is inserted which does not allow any more gas out. These are made of harder wood (usually still technically "softwood", but denser and more solid than a soft spile). When beer is being drawn from the cask a hard spile is removed and can be replaced by a soft spile, or left open. When no beer is being dispensed a hard spile is put back in. Plastic spiles are also available.
Once a spile is reinserted, enough gas will be generated by the yeast to replace the volume of gas that will have come out of solution. But the amount of carbon dioxide that can be produced is limited, so a hard spile is kept in as much as possible. This is one of the reasons for real ale's short shelf-life once a cask is opened – if too much carbon dioxide is lost, the beer will become flat. Typically, the beer will be good only for two to four days; this short shelf life is why it is important that a pub serving real ale have sufficient turnover for casks to be emptied while still at their best.
Like many such older terms, the word spile has other local meanings. For example:
A spile is utilized to obtain water in the novel Catching Fire (2009) and subsequent film The Hunger Games: Catching Fire (2013).
The spile consists of a tube with one end sharpened and the other split. When pounded into a tree, a stream of fresh water flows from the tube. Most of the year, this is not consistent with the nature of trees, as water diffuses upward through very tiny capillary passages. When a tree is cut down, water does not flow out of the cut surface. The technique used in the movie would only work in early spring or late winter, when the watery sap runs high in the trees.
The taps that are placed in maple trees are placed into drilled holes and the resultant fluid is sap, not water.
^ 1: Properly served, there should be no significant quantities of this yeast present in the beer as it is drunk. During the conditioning process, finings help to gather the yeast into clumps ("flocculation") which sink into the belly of the cask below the tap. Only if the cask is shaken, tilted too far, or served too early will the yeast find its way into the glass. ^ 2: Stronger beers will last longer, mostly because the increased alcohol content serves as a preservative. Nevertheless, they may be a little flat by the end of their life..