Every time your hero gains a level, they also gain a point of Spell Mastery.


Higher levels of Spell Mastery unlock a more powerful weapon of a matching color. 


So if you want to unlock a Legendary Bow, you better start leveling up your (Green) Earth Mastery at every available opportunity!