After the First Barbary War, the European nations had been engaged in warfare with one another (and the U.S. with the British). However, in the years immediately following the Second Barbary War, there was no general European war. This allowed the Europeans to build up their resources and challenge Barbary power in the Mediterranean without distraction. Over the following century, Algiers and Tunis became colonies of France in 1830 and 1881 respectively,
while Tripoli returned to the control of the Ottoman Empire in 1835. In 1911, taking advantage of the power vacuum left by the fading Ottoman Empire, Italy assumed control of Tripoli. Europeans remained in control of the government in eastern North Africa until the mid-20th century. By then the iron-clad warships of the late 19th century and
dreadnoughts of the early 20th century ensured European dominance of the Mediterranean sea.
[citation needed]
The Ottoman empire had fought a number of battles during the Napoleonic wars, usually in alliance but occasionally against British Sea power, and had no illusions about what their breakaway states would face.
Ref to the career of Sir Sydney Smith, the 'Swedish Knight".