Why does Hollow Knight stab himself?

Why does Hollow Knight stab himself? Meaning the act of stabbing himself is not actually hurting him but rather increasing his defense momentarily. 2) We have never seen ANY other character regain control of their own body while infected.

Meaning the act of stabbing himself is not actually hurting him but rather increasing his defense momentarily. 2) We have never seen ANY other character regain control of their own body while infected.