One of two things went wrong (or both). Embassy staff was more determined and better armed than anticipated, and killed some of the attackers. That pissed them off and they killed the ambassador, and the rest were rescued by the Americans, or the attackers double crossed Obama.
Two Navy Seals showed up. If they’d been granted the proper support, things would have ended much differently.
I’m not sure how this happened, but this went to the wrong article...