Since ancient times, pilots have guided ships in and out of port, where the waters have the greatest risks.

This institution indeed established itself progressively as maritime trade developed.

For safety reasons, the captain requires the assistance of a “local guide” who possesses all the necessary knowledge of the harbor, the seabed, the currents, and the coastal and port configurations, so that the ship can safely enter or leave the facilities designated for it.
Navigation Ordinance issued during the reign of Henry II
Henri II
The requirement for pilotage dates back to an edict of 1551, issued during the reign of Henry II, which stated:

The master of the ship shall, in order to avert any danger threatening the lives of the crew or the cargo, be required to take on a pilot wherever necessity and custom so dictate; if he fails to do so, he shall be fined 50 gold reales for each such instance. He shall also compensate the shipper for the expenses and losses incurred as a result of this negligence. The pilot shall be paid from the cargo by the shipper and shall be provided with meals by the shipowner if his wages do not exceed 6 pounds of Flanders cloth. If they exceed this amount, his wages shall be charged as general damage against the ship and the cargo.”
Colbert's Marine Ordinance
Colbert
Colbert's ordinance, issued in 1681 during the reign of Louis XIV, is a fundamental document.
The 1681 Marine Ordinance
It sets forth the fundamental principles of pilotage, which still govern the practice today: these include, first and foremost, the obligation to pilotage, its monopoly, the oversight by the Admiralty, the pilot’s knowledge, and also, penalties for pilot misconduct. Thus, for example, “if he deliberately causes the ship to run aground, he [the pilot] shall be punished by death, and his body shall be tied to a mast erected near the site of the wreck.
The emergence of the concept of a pilotage station under Napoleon I
Napoléon I
It was not until the decree-law of December 12, 1806—inspired by the ordinances of 1562, 1584, and 1682—enacted during the reign pof Napoleon I that pilotage stations were established; until then, pilots had been organized into guilds.
Commander Mas, 1st President of the French Federation of Pilots
Commandant Mas
The Decree-Law of December 12, 1806, was replaced by the fundamental text still in force today, the Law of March 28, 1928, initiated by Commander Mas, the 1st President of the French Federation of Pilots, who was tasked by the government of the time with considering the reorganization of pilotage in French ports.

This law has undergone numerous amendments, first introduced by the decree of May 19, 1969, which was itself amended by the decrees of April 26, 1974, July 28, 1976, September 18, 1978, August 1, 1980, March 14, 1986, and May 25, 2000.