Cocktail mode is an example of how backward compatibility is something that plagues not only computer manufacturers, but video game makers as well. The basic idea behind cocktail mode is that the players sit across from each other and the game plays one player at a time, and flips the display to face the player controlling the game. Many games that supported 2 players simultaneously in upright mode would still have a cocktail mode with alternating play.
The earliest cocktail games (which usually did not use a microprocessor), used a rather unique method of flipping the screen. What they did was drove a relay that actually reversed a pair of wires on the monitor chassis, thus flipping the game by actually causing the monitor to produce the image upside down, rather than the usual method of simply sending the monitor an inverted picture.
Most games had cocktail mode enabled by flipping a dip switch located on the main game PCB. A few other games did it via a setup menu (similar to the BIOS of a modern computer), while other games did it by grounding or ungrounding a certain pin on the edge connector. There were a few games (Warlords, Carnival and others), that used a totally different PCB for cocktail mode, and were not configurable.
One small note, a few titles (mainly Defender), had cocktail mode added to the hardware mid-production, so sometimes you will run into a board which should have cocktail support, but does not (which is common with Defender boards, some of them literally do not have the hardware on the board to flip the screen).
Cocktail mode was supported in most video arcade game PCBs manufactured from 1978 to the around the mid 1990s. Games that were not available in a cocktail format often still supported cocktail mode. The cocktail format was immensely popular in the early 80s, but it basically went completely out of production in 1983. But the install base of cocktail cabinets was so large that game manufacturers had to deal with those tables for a long time afterwards.
Cocktail mode eventually became less common with the advent of Street Fighter II and other fighting games, although most non-fighting games still supported it. It finally completely died out in the mid-90s, approximately 13 years after cocktail table production had stopped. Now even games which should support cocktail mode (like Konami 80s Gallery), no longer support it.