A doubleheader (aka twin bill) is when two games are played on the same day. Unless specifically described otherwise, the two games in a doubleheader are between the same two teams and paid for with a single admission price, and the second game starts shortly after the end of the first game. A day/night doubleheader requires separate admission for each game, and the games are scheduled far enough apart that the team can empty the park and prepare the stands for the second game. On some very rare occasions, a team has played a doubleheader with a different opponent in each game.
Doubleheaders may be scheduled in advance or be played to make up for earlier games that were postponed, called before they became official, or ended in ties. They were common before World War II and the advent of air travel. Travel was slower, which required teams to have many more travel days than they do today and made it impossible to play a full schedule without some doubleheaders. Teams that were allowed to play on Sunday would normally schedule Sunday doubleheaders to attract more fans. Holiday doubleheaders, such as on the 4th of July or Labor Day were also fixtures. Teams also lost more games to weather and darkness, requiring more unplanned doubleheaders to make up for the games lost.
Doubleheaders are comparatively rare today. The Collective bargaining agreement forbids teams from playing day/night doubleheaders except to make up for earlier postponements, and teams are reluctant to schedule single admission doubleheaders because they don't want to lose ticket revenues. The result is that doubleheaders are now played only as makeup games, and improved groundskeeping, artificial lights, and indoor stadiums have greatly reduced the need.
Even though doubleheaders have now become quite infrequent, in 2012 Major League Baseball implemented the 26th Man Rule which allows teams to add a player to their roster when a doubleheader is scheduled.