It originally meant that when the army was placed in a situation where it could not retreat and only died in battle, the soldiers would advance bravely and kill the enemy to win. The latter metaphor is that if you cut off the retreat in advance, you can make up your mind and achieve success.