By the time of the Napoleonic wars, an infantry battalion usually had two majors, designated the "senior major" and the "junior major". The senior major effectively acted as second-in-command and the majors often commanded detachments of two or more companies split from the main body. The second-in-command of a battalion or regiment is still usually a major.
From 1 April 1918 to 31 July 1919, the Royal Air Force maintained the rank of major. It was superseded by the rank of squadron leader on the following day.
By World War I, majors were often commanding independent companies, squadrons and batteries, but those that were organically part of a regiment or battalion were still usually commanded by captains. After World War II, major became the usual rank held by Officers Commanding all companies, squadrons and batteries, and remains so today.