A last stand is a military situation on which a normally-small defensive force holds a position against a powerful entity.
The defending force usually takes heavy casualties. That can take the form of a rearguard action, holding a defensible location, or simply refusing to give up a position. A last stand is a last-resort tactic that is used if retreat or surrender is impossible or fighting is essential to the success of the cause. The defending force is most likely defeated, but it sometimes survives long enough for reinforcements to arrive that force the retreat of the attackers; it can even occasionally force the enemy away by itself.
At various times in history, last stands have ended with a defeat in the strict immediate military sense, but they have become moral victories by creating a heroic myth, which can be a great political asset to the cause for which the last stand had been fought.
Land-based last stands
Naval last stands
...