In extreme CQB, like grappling, a knife is a very good option, better than a firearm in many ways.
If wielded properly, it is very difficult to be wrested away, unless the assailant has mad knife skills himself.
A knife can't be rendered inoperable by clasping or gripping it.
Knives are intimidating at a primal level; no one likes the idea of being cut.
Obviously, not letting someone close the distance to you would allow use of a superior weapon (read: handgun), but in the real world, you may not have that luxury.
Like any weapon, if a knife is carried with the intention of self defense, you should practice as you would with any other weapon. If you are not prepared mentally to use it, it won't be nearly as effective.
Busting thugs since 1992