A team in baseball refers to the collection of players that are either playing offense or defense. Every game of baseball consists of two teams who take turns to bat and field. The fielding team is known as the defense and the batting team is known as the offense. Baseball is one of the few games in which the defense has more control over the game than the offense.
A team in baseball consists of nine players. Only nine players are allowed on the field at any given time. However, a roster can consist of 40 individuals, who can be substituted if needs be. The defense team has 9 players out at all times on the field. They have 9 positions to fill which include the pitcher, the catcher, the shortstop, the first baseman, second baseman and third baseman, and the outfielders.
All of these roles work together to put the batter or the base runners on the offense team out.
You can read more about the different roles in baseball in How Many Players are on a Baseball Team?
In MLB, 30 teams compete in two leagues.