The name hannya (般若) comes from the Sino-Japanese word "Prajna" with the meaning wisdom, one tradition states that this name was given to this mask because it was the name of a monk Hannya-bō (般若坊), an alternative explanation is that the artist would need a lot of wisdom to create this mask.
The intimidating and intense hannyas masks were first seen around the 14th century in the "Noh Theater", a traditional Japanese musical theater, very popular at the time. The plays presented sometimes featured a character who transformed into a demonic creation and this gave rise to the Hannya mask.
The Hannya mask was constantly used in plays to represent a woman who became overcome with jealousy, anger, envy, possessed, taking the form of a demon.
Hannya's mask is also an amulet that protects you against evil, greed and envy. She distances herself from precisely what she represents, precisely because she has these feelings so concentrated, she repels them.