Article snapshot taken from Wikipedia with creative commons attribution-sharealike license.
Give it a read and then ask your questions in the chat.
We can research this topic together.
The Barbary Coast (also Barbary, Berbery, or Berber Coast) was the name given to the coastal regions of central and western North Africa or more specifically the Maghreb and the Ottoman borderlands consisting of the regencies in Algiers, Tunis, and Tripoli, as well as the Sultanate of Morocco from the 16th to 19th centuries. The term originates from an exonym for the Berbers.
In 1625, the pirate fleet of Algiers, by far the largest, numbered 100 ships of various sizes, carrying 8,000 to 10,000 men. The corsair industry alone accounted for 25 percent of the workforce of the city, not counting other activities of the port. The fleet only averaged 25 ships in the 1680s, but these were larger vessels than had been used since the 1620s, so the fleet still employed some 7,000 men. In addition, 2,500 men manned the pirate fleet of Tripoli, 3,000 in Tunis, and several thousand more in the various minor pirate bases such as Bona, Susa, Bizerta, and Salé. The corsairs were not solely natives of the cities where they were based; while many were Arabs and Berbers, there were also Turks, Greeks, Albanians, Syrians, and renegade Italians, especially Corsicans, among their number.
The establishment of the U.S. Constitution in 1789 empowered the federal government to levy taxes and maintain a military, authorities previously absent under the Articles of Confederation. The nascent nation's first naval vessels were commissioned in 1794 to counter Algerian piracy. Subsequently, in 1801, the Pasha of Tripoli declared war on the United States, citing unpaid tribute.
The first overseas military land action of the United States was executed by the US Marines and the US Navy in April 1805 at the Battle of Derna, at Tripoli, a coastal city now in eastern Libya. It was part of an effort to destroy the Barbary pirates and end piracy between warring tribes by the Barbary states, which were themselves member states of the Ottoman Empire. The opening line of the Marines' Hymn refers to this action: "From the halls of Montezuma to the shores of Tripoli...".
Ben Rejeb, Lotfi (2012). "'The general belief of the world': Barbary as genre and discourse in Mediterranean history". European Review of History: Revue européenne d'histoire. 19 (1): 15. doi:10.1080/13507486.2012.643607. S2CID159990075.
Hinz, Almut (2006). "Die "Seeräuberei der Barbareskenstaaten" im Lichte des europäischen und islamischen Völkerrechts". Verfassung und Recht in Übersee / Law and Politics in Africa, Asia and Latin America. 39 (1): 46–65. JSTOR43239304.