In 1786, Thomas Jefferson, then a minister to the French government of Louis XVI, had a concern more intimidating than anything else he’d faced before: the threat of pirates off the coast of North Africa, a region known as the Barbary Coast. These pirates had already taken over two American ships, the Dauphin and the Maria, plundering their goods and taking their crews hostage. Unfortunately, this was a common fate for ships venturing near the area, where the Sahara’s arid coast was divided into four Islamic nation-states. Running west to east were the Barbary nations Morocco, Algiers, Tunis, and...