A bunghole is a hole drilled into a barrel, cask, or keg for the purpose of accessing the liquid inside. The use of bungholes dates back to ancient times, and persists to this day. Most typically, bungholes are used to access goods like beer and wine, although technically any sort of container of liquid could be tapped to create a bunghole.
Many people are familiar with the slang sense of “bunghole” in reference to a particular anatomical feature. This sense of the word dates to around the 13th century, and was especially popular in the days of Shakespeare, an author who seemed particularly fond of this epithet, going so far as to construct complex raunchy metaphors around the bunghole to appeal to the earthy sensibilities of Elizabethan playgoers.
As you might surmise from the name, a bunghole is a hole for a bung, a form of specialized plug. When a container of liquid is tapped, it allows oxygen to enter the chamber, potentially oxidizing the contents and causing them to go off. As a result, it is important to snugly plug the bunghole when it is not in active use. Historically, people used a wedge-shaped cork to ensure that the hole would be totally filled, but easy to re-open. Modern bungholes are typically plugged with specialized taps which are sometimes built directly into the cask, keg, or barrel for an airtight seal.
When producers started shipping beer and wine in large barrels and other containers in Greek and Roman times, they usually shipped the container in sealed form, with the end purchaser opening a bunghole with the use of a specialized drill. Since barrels were often re-used, bungholes might be periodically patched, and some lazy merchants simply left old holes plugged, opening new ones as needed. The bunghole was usually opened by the cellar keeper, who would also test the contents to make sure they were fit for consumption.
The location of a bunghole is not terribly important. Placing a bunghole too low on a cask can increase the risk of pouring out sediment along with the liquid contents, but beyond that, the placement is dependent primarily on the arrangement of one's cellar. The hole may be placed in the staves or side of the barrel, or the head, the top of the barrel, depending on personal taste. Alas, most modern consumers do not get to drill their own bungholes, since beverage companies prefer to make their own standardized holes and taps to ensure that the quality of their products is not compromised.