The totem is used to create a team of up to 8 players. Joining a team brings many benefits, such as shared doors and spikes, and only receiving 30% of the damage dealt by teammates. To join a team, players have to stand near the totem and click the green player head button that appears at the top of the screen. But mangers can lock the totem at the Crab in the Bed update. So you can't join if totem is locked.
When in a team, there will be a green player head icon next to your teammate's names. The creator / leader (which is whoever placed the totem) of the team has a green crown icon next to their name. These icons can only be seen by you and your teammates.
Players in a team are able to share doors and locked chests. They are also immune to damage from spikes or Thorn Bushes built by their teammates. Teammates can only deal 30% damage to each other, making betrayal harder.
Players can leave a team anytime by clicking on the green player button at the top of the screen and then choosing 'Leave'. The creator of the team has the unique ability to kick others from their team by standing next to their totem, and pressing the X right next to a player's name. When kicked or leaved, that player has to wait for about 20 seconds before can join any other team.