A Defensive Pact is an agreement between two leaders to come to each other's aid when targeted by a Declaration of War. It is unlocked by the Mobilization Civic, and both partners must possess this Civic in order to create a Defensive Pact. If either member of the Defensive Pact is targeted, the other member will also declare war against the aggressor. Defensive Pacts are available through the Make Deal negotiation table. The two leaders must be in an Alliance to make the deal.
There are some cases where a Defensive Pact will not automatically lead to a leader being drawn into a war as the result of being in a Defensive Pact. For example, Gilgamesh and Cleopatra have a Defensive Pact, and Pedro and Peter have a Defensive Pact. Gilgamesh declares war on Pedro, and due to the Defensive Pact, Peter declares war on Gilgamesh. However, Cleopatra does not automatically declare war on either Pedro or Peter. Emergencies do not trigger Defensive Pacts, either. Using our example from before, if there were an Emergency against Pedro, and Gilgamesh goes to war against Pedro, then Peter does not automatically declare war on Gilgamesh.