We use the phrase “to stab in the back” almost always figuratively, to deliver a cowardly blow, physically or against one’s character, and we usually use it with reference to such a delivery by one who was thought to be friendly, or at least not suspected to be inimical.
The literal origin goes back to the times when footpads, with a dagger beneath the cape, would unconcernedly approach and pass an unsuspecting victim, quickly flash out the knife as the pedestrian was passing and thrust it into his back, grabbing his purse as he fell, and dashing away from the scene.