The term originally came about from someone declaring that he was going to "ninja punch" another, but bent his wrist upon impact and ended up hurting himself more than the other person.
Ninja punch can apply to any action, not just a punch, in which the person doing the "ninja punch" is attempting to show off to others, and fails horribly.

While playing a role play game, Billy attempted to throw a grenade at the enemy by bouncing it off of three walls and down the hall. Sadly for Billy, and those standing next to him, he rolled a 1 (critical failure) and dropped the live grenade at his feet.
One of the other plays declared "Way ta ninja punch!"

In the act of giving anal sex, while all the lights are off use a dildo instead of your wang and sneak infront of the reciever while they think you are behind them, and in one quick movement turn on the lights and punch them in the face screaming "ninja punch bitch!"