Both have a fantasy school setting.
Both are power fantasies with a protagonists that any cultured man could project himself onto.
Of course both have themes of magic and such, and are about a teacher with his students.
Both shows have MCs who are overpowered but keep their true strength a secret unless you mess with them. They also both have magic competitions where girls compete with each other using their magic powers.