late Old English mægester "a man having control or authority over a place; a teacher or tutor of children," from Latin magister (n.) "chief, head, director, teacher" (source of Old French maistre, French maître, Spanish and Italian maestro, Portuguese mestre, Dutch meester, German Meister), contrastive adjective ("he who is greater") from magis (adv.) "more," from PIE *mag-yos-, comparative of root *meg- "great." The form was influenced in Middle English by Old French cognate maistre.
From late 12c. as "man eminently or perfectly skilled in something," also "one who is chief teacher of another (in religion, philosophy, etc.), religious instructor, spiritual guide." Sense of "master workman or craftsman, workman who is qualified to teach apprentices and carry on a trade on his own account" is from c. 1300. The meaning "one charged with the care, direction, oversight, and control of some office, business, etc." is from mid-13c.; specifically as "official custodian of certain animals kept for sport" early 15c. (maister of þe herte houndes; the phrase master of the hounds is attested by 1708). As a title of the head or presiding officer of an institution, late 14c.; as "captain of a merchant vessel" early 14c.
In the broadest sense, "one who has power to control, use, or dispose (of something or some quality) at will," from mid-14c. Also from mid-14c. as "one who employs another or others in his service" (in which sense the correlative word was servant, man, or apprentice); also "owner of a living creature" (dog, horse), also in ancient contexts of slaves; paired with slave in the legal language of the American colonies by 1705 in Virginia.
In academic sense "one who has received a specific degree" (translating Medieval Latin magister) it is attested from mid-13c., originally "one who has received a degree conveying authority to teach in the universities;" master's degree, originally a degree giving one authority to teach in a university, is from late 14c.
Also used in Middle English of dominant women. From 1530s as "male head of a household." As a title or term of respect or rank, mid-14c. As a title prefixed to the name of a young gentleman or boy of the better class not old enough to be called Mr., short for young master (late 16c.). Sense of "chess player of the highest class at national or international level" is by 1894. Meaning "original of a recording" is by 1904.
As an adjective from late 12c. Master bedroom is by 1919. Master-key, one that will open ("master") a number of locks so differently constructed that the key proper to each will open none of the others" is from 1570s. Master race "race of people considered to be pre-eminent in greatness or power" (typical in reference to Nazi theories of the Aryan race, perhaps based on German Herrenvolk) is by 1935. From 1530 as "artist of distinguished skill;" old masters is attested by 1733.