the identify intruders through smell and through chemicals One of the first ways that bees protect themselves is by building their hive in a very secret spot. ... Another way that bees will defend themselves is by stinging. Ouch! Female bees have a stinger on the end of their body and they will use it to sting something that might be threatening it.
Bees know what the bees within their hive smell like.
Intruders will smell different and they will sting the intruder.
(Interesting fact: When honey bees sting, they release pheromones that stir up nearby bees. One stinging bee can turn into hundreds or even thousands of stinging bees in just a short time.)