A corsair was a French privateer who attacked enemy shipping in the Mediterranean. Corsairs were active in the Mediterranean from around the 11th century to the 1800s, when privateering was finally banned by collective agreement in Europe. Many people use the term “corsair” interchangeably with “pirate,” although this usage is not technically correct.
The difference between privateers and pirates is important, because the two enjoyed a different status in the eyes of the law. Privateers were officially licensed by the crown to raid enemy shipping, returning to their home ports with the prizes and splitting them with the crown. Pirates, on the other hand, operated beyond the law, raiding all shipping indiscriminately and not being granted any legal protections.
Corsairs are named for the lettres de course which they carried. A lettre de course could only be issued by the French king, and it essentially acted as a commission, allowing the corsair and crew to attack enemy shipping. If corsairs went after ships belonging to neutral nations or allies, they would be treated as pirates, and punished accordingly.
Of course, from the perspective of an enemy, a corsair would be little more than a common pirate. If foreign ships managed to catch corsairs, they could punish the captain and crew as pirates, and this was a risk run by all privateers. Corsairs were also subject to raids from genuine pirates, who might view a ship loaded with haul as a tempting prize.
The corsairs emerged in the Middle Ages as a purely practical arm of the French Crown. The French treasury was woefully low due to a series of conflicts, and the king realized that raiding enemies would be an easy way to replenish State funds while also hurting the cause of France's enemies. Many other European monarchs got the same idea, making the high seas a dangerous place. Most corsairs stuck to the Barbary Coast, the coastline along North Africa, and they sometimes came into conflict with Muslim privateers known as the Barbary Pirates.
Corsairs typically sailed very fast, easily handled ships which also came to be known as corsairs, sometimes using galley slaves to get the upper hand. They were famous for their boldness, speed, and swashbuckling attitude, and like other privateers and pirates, they could also be quite brutal. If a ship's crew resisted, they might find themselves summarily executed by the corsairs, although they could usually avoid being pressed into service on a corsair ship, unlike the victims of pirate attacks. Corsairs were also not above the use of subterfuge; for example, they might fly the flag of an enemy to lure a ship close to them before producing their lettre de course and boarding.