Bees typically sting as a defensive mechanism to protect their hive or themselves when they feel threatened. When a bee stings, it injects venom, which can cause pain and sometimes allergic reactions in humans. It’s important to remain calm and avoid swatting at bees to reduce the likelihood of getting stung.