Maiestas (majestas) comes from major, the comparative of magnus = large, great. Magisterium comes from magister = teacher, master (in the British sense). I don't know that the two words are related; their similarity may be accidental.