It shows up even earlier in the 15th century in relationship to ‘master of hounds’, there still spelled in the early form ‘maister’. In Middle English it seems to appear first in the meaning of a man skilled in his craft or in having control over the teaching of academics. But, the idea of control over a place or ownership/control of animals comes right along with that. Originally it comes from the Latin: ‘magister’ which has all of those meanings as well. So showing up in both forms makes sense, as the Latin transferred itself into the English.
I’d note, being a master craftsman or a ‘master of hounds’ was not just a judgement of skill. It carried real legal weight, you couldn’t just call yourself a master carpenter for example. You had to pass a fairly rigorous apprenticeship under a master first. We still see faint echoes of this in things like the plumbing trade, where ‘journeyman’ still means something. Or as you note in the electrical trade! Hunting was a serious thing in the Medieval period and a Master of Hounds, would have had a huge amount of authority not just over the hounds but over the area that was reserved for hunting.
In the medieval period, a ‘master’ is fundamentally different from a ‘lord’. The master’s rights of control are legally based in the same way as the sheriff’s rights are based; the lord’s rights are based on their family/feudal relationship to the king, or other nobles. It gets very complicated! But, this legal basis rather than blood/divine basis reflects back to the idea that the master’s authority is skill based. A master has demonstrated and proved his ability and skill at his craft and therefore has the right to either teach it or to control how other people practice it.