What is Captain?

Legal Definition
Captain and chief officer are overlapping terms, formal or informal, for the commander of a military unit, the commander of a ship, airplane, spacecraft, or other vessel, or the commander of a port, fire department or police department, election precinct, etc. Captain is a military rank in armies, navies, coast guards, etc., typically at the level of an officer commanding a company of infantry, a ship, or a battery of artillery, or similar distinct unit. Chief officer may be used interchangeably with captain in some situations, as when a Captain-ranked Navy officer is serving as the commander of a ship. The terms also may be used as an informal or honorary title for persons in similar commanding roles. In mining (esp. Cornish), it is an honorific given the superintendent or manager of a mine.

The term "captain" derives from katepánō (Greek: κατεπάνω, lit. "[the one] placed at the top", or "the topmost") which was used as title for a senior Byzantine military rank and office. The word was Latinized as capetanus/catepan, and its meaning seems to have merged with that of the late Latin "capitaneus" (which derives from the classical Latin word "caput", meaning head). This hybridized term gave rise to the English language term captain and its equivalents in other languages (Capitan, Capitano, Capitão, Kapitan, Kapitän, Kapitein, Kapteeni, Kapten, Kapudan Pasha, etc.).
-- Wikipedia
Legal Definition
A head-man; commander; commanding officer. The captain of a war-vessel is the officer first in command. In the United States navy, the rank of "captain" is intermediate between that of "commander" and "commodore." The governor or controlling officer of a vessel in the merchant service is usually styled "captain" by the Inferior officers and seamen, but in maritime business and admiralty law is more commonly designated as "master." In foreign jurisprudence his title is often that of "patron."

In the United States army (and the militia) the captain is the commander of a company of soldiers, one of the divisions of a regiment. The term is also used to designate the commander of a squad of municipal police. The "captain of the watch" on a vessel is a kind of foreman or overseer, who, under the supervision of the mate, has charge of one of the two watches into which the crew is divided for the convenience of work. He calls them out and in, and directs them where to store freight, which packages to move, when to go or come ashore, and generally directs their work, and is an "officer" of the vessel within the meaning of statutes regulating the conduct of officers to the seamen. U. S. v. Trice (D. C.) 30 Fed. 491.
-- Black's Law Dictionary