Only worker bees sting when they are in a desperate situation, but not all bee species sting.
The stinger is a hollow tube through which the poison passes and that is attached to some internal organs. Apart from the poison, it is important to remove the stinger immediately because when the bee stings, it releases an alarm pheromone that triggers the attack of other worker bees.
When a person is stung, the bees introduce their stinger. Since its profile is serrated and our skin is thick, the stinger gets stuck and they have no choice but to leave it there. This causes an abdominal tear (leaving behind its digestive tract) and it is the cause of the bee’s death.
However, this does not occur in all bee species. Also, when they sting an animal with thinner skin they can remove the stinger without dying.
The process of leaving part of the body behind as a form of defense is called autotomy. Another example of autotomy is the loss of the tail of lizards when they feel threatened.