Mastery refers to having great skill at something or total dominance over something. If you are fluent in French, you have a mastery of the language. If you win every game of chess, you show a mastery of the game.
Mastery is from master, who is someone knowledgeable about a subject, like a master painter. Masters are also people with power — butlers sometimes call their employer master. Mastery refers to a similar power or ability. Beethoven showed mastery in composing. Shakespeare displayed mastery in writing. Apple has had mastery over the field of computers and smartphones. Often, both senses are mixed: if someone has mastery over a field skill-wise, they probably have mastery in terms of dominance too.