wikipedia says: The original meaning of the master's degree was thus that someone who had been admitted to the rank (degree) of master (i.e. teacher)
and
from Latin: magister, "teacher"
teaching requires mastery, not leadership, although the concepts are related because mastery is also good for leadership.
my armchair etymology suggests that master and mastery were closely related until it started to be applied to leadership as well.