It's really just the time periods they were primarily used in. Your majesty was also typically used just for royalty where your highness could have been used towards any superior of the clergy, noble lords or royalty.
I think your highness is generally used for female gender and your majesty is used for male gender. For queen we use "Highness" and for king we use "Majesty"