The "Boston Massacre" occurred in 1770 when a few British soldiers were cornered by a large number of colonists who were throwing snowballs, rocks, and oyster shells at them. No one knows exactly who yelled, "Fire," but the British fired and killed a few Americans. (5 of them total).
"Being cornered" describes being pinned or trapped in one place. You can't move. You're stuck. These British soldiers were surrounded by so many colonists that they could not get away from the fight.
Literally, it means being trapped in a corner of a room or of something else with a corner. Imagine being in a small room with a huge crowd. You go to the corner to get some space. But the crowd surrounds you. You can't go left, right, or straight ahead because everywhere around you is this crowd of people, like a wall you can't get past. You're stuck where you are. You are literally being cornered by this crowd.
It can be used more liberally, with no corners involved. Such as if you went to the bathroom and run into your boss, who starts a conversation with you. Even though you obviously want to get out of the conversation, your boss keeps blocking you from walking around/past him and forces you to continue this conversation. Your boss has cornered you in the hallway.