The stinger usually gets stuck when they sting a mammal and the bee dies. When they sting other insects like other bees, the stinger may or may not get stuck depending on where they sting and how deep the stinger penetrates. I have watched bees sting each other in my observation hive and sometimes they can repeatedly sting other times they get stuck the first time.