The 40-man roster includes a combination of players on the 26-man roster (it was 25, prior to 2020), the 7- and 10-day injured lists, the bereavement/family medical emergency list and the paternity leave list, as well as some Minor Leaguers.
In order for a club to add a player to the 26-man roster, the player must be on the 40-man roster. If a club with a full 40-man roster wishes to promote a Minor League player that is not on the 40-man roster, it must first remove a player from the 40-man roster -- either by designating a player's contract for assignment, trading a player, releasing a player or transferring a player to the 60-day injured list.
A player who is on the 40-man roster but does not open the season on the 26-man roster must be optioned to the Minor Leagues. Only one Minor League option is used per season, regardless of how many times a player is optioned to and from the Minors over the course of a given season. Players typically have three option years, although a fourth may be granted in certain cases (usually due to injuries). Out-of-options players must be designated for assignment -- which removes them from the 40-man roster -- and passed through outright waivers before being eligible to be sent to the Minors.
The 40-man roster is an important distinction in the offseason, as players who are on the 40-man roster are protected from being selected by another organization in the annual Rule 5 Draft, held each year in December at the Winter Meetings.