Major is a military rank the use of which varies according to country. Depending on the country, the rank derives either from "Captain-Major", a rank of senior captain, or "Sergeant-Major" a rank of senior sergeant.
In most countries Major derives from Captain-Major and denotes a mid-level command status officer (immediately superior to the rank of Captain and immediately subordinate to the rank of Lieutenant Colonel). Where major derives from sergeant major, notably in France, major is a senior sub-officer rank.
The original usage is illustrated in the first recorded(?) English (1643) attestation, as "Sergeant-Major", 'the third-in-command of a regiment'. The early German equivalent was Feld Wachtmeister, in which Field functions as major and Wachtmeister ('watch master' or 'quarter[-ing] master') is the more commonly used term for a cavalry sergeant. Similarly we early on find Spanish Majors referred to Sargento Major.
In several European navies, the rank of Major was used in the sense or form "Pilot-Major" to denote the senior deck officer of a vessel in contrast to the Captain (or Captain General) who was typically an Army officer, with little naval knowledge, assigned to command the mission on which a vessel was embarked. The English equivalent of this usage is Master, as opposed to the Captain or Commander.
In the Spanish navy of the 16th and 17th centuries, the captain's principal seaman was the "maestre" (master) who was responsible for the maritime operation of the ship. Next in the chain of command was the "piloto" (pilot) responsible for the safe navigation of the ship. A flagship's pilot was the "piloto mayor" (chief or major pilot) who determined the course of the whole squadron.
By the time of the English Civil War, Major had become a rank in itself, and was assigned to mid-level officers on the battlefield, and was most often used by those serving as aides to a superior General.
In Argentina, the armed forces all use the rank of sub-officer-major as the highest non-commissioned rank. The army and air force also use the officer rank of major. The army has a rank of colonel-major, but this is essentially an automatic promotion for long-serving colonels rather than a functional rank in its own right. The Argentine National Gendarmerie uses the rank of commandant-major, which is roughly equivalent to a colonel or chief superintendent in the commonwealth.
It is similarly still used as a prefix for the General officer rank of Major-General, which is similarly used in many other languages (e.g. General-Major in Dutch).