I just read Kilmeads’ book on the subject. The pirates went out into the Atlantic, not just the Mediterranean. Ships of both nations were docked in Gibrealer here they couldn’t fight each other unless they went out to sea.
Question: Was this another deep state endeavor? It was merchants they were after, not us. US taxpayers get stuck with the bill. Europe wouldn’t defend themselves.
Revenue into the U.S. Treasury during that time frame came substantially solely from customs duties. So to the extent trade was brutalized by the pirates, customs duties fell. The military expenditures were justified once the political decision was made (basically beginning with Jefferson) that the U.S. was bloody well sick and tired of paying monetary tribute to the mercurial Beys.
They didn’t bother Brits or Frogs cause those navies bloodied them. The Italian city states found it cheaper to pay as did the Portagee. Spain went back and forth.