In the NBA, there are 10 players on the court at all times. Five players are dedicated to each team. Nothing can happen to cause fewer players to be on the court, short of someone being sent into the second row. Baseball always has nine players on the field and in the lineup. It never changes. Football will always have 11 players to a side, except for the occasional time a team tries to get away with 12 or even 13 on defense (which is a penalty). Hockey is not that straightforward.
How many players can be on the ice at once in the NHL?
Before getting into today's game, let's first get into the history of this. In the earliest iterations of hockey, there seemed to be no rules as to how many players could be on the ice at one time. There were reports that as many as 30 players were on the ice at one time. NHL rosters of today are only 23 players.
The McGill University Hockey Club is honored as the first organization to make a set of universally followed rules for the sport of ice hockey in 1877, according to Britannica. They declared that each team was only allowed to have a maximum of nine players on the ice at once. Sounds pretty crowded. Some say that the rules for early hockey come from field hockey, which plays 11 to a side including the goalie.
As the years went by, more and more players were taken off the ice. The Amateur Hockey Association in Canada shorted the teams to seven per side when it was established in 1885.
Of course, today, the normal game is played with five games per side with the forwards and then one goalie. Penalties can change that, as does overtime, but we'll get into that in a moment. Six total players are allowed on the ice, and one can be a goalie but doesn't have to. It's against the rules to play two players in goalie pads. It is not against the rules to pull the goalie and replace him with a sixth forward. In fact, it happens in most games that are close with less than two minutes left.
Overtime changes the rules
If a game is tied at the end of regulation (the allotted time for a game, which right now is 60 total minutes), the teams will play a five-minute overtime session. This has changed throughout the years, with overtime for many years being the same 5v5 that normal play is, but then it moved to 4v4 to drive more offense. After the 2004-05 NHL Lockout, the league created the shootout. It's a parlor game that finds the winner of a hockey game. When it became critical that too many teams were winning or losing in the shootout, the NHL created 3v3 overtime prior to the 2015-16 season, which became an offensive onslaught that really brought an edge-of-your-seat excitement to five-minute overtime.
Players behaving badly force their teammates to play at a disadvantage
Penalties will change the players that are allowed on the ice. Penalties that impact the number of players on the ice are broken into three categories. Minor penalties keep players out for two minutes. Double minors keep players out for four minutes. Major penalties keep players out for five minutes. The minor penalties are over when the other team scores a goal, but major penalties are five minutes of unstopped advantage. The only comparison between these penalties is they all take one player off the ice. There are no singular penalties that takes off more than one player.
The penalties can stack, however. Even if two penalties happen on the same play by different players, both players will go to the penalty box. That will leave the team at a 5v3 disadvantage. There are five possible penalty situations: 5v4, 5v3, 4v4, 4v3, and 3v3. The more players that are sent to the box, the more space on the ice and usually the more offense you see.
So, there you have it. The normal hockey game is played with five forwards/defensemen to a side and a goalie unless the goalie is pulled and it becomes six skaters. Then, penalties and overtime can change that.