A parting shot is often a last-ditch effort to accomplish something, or something done while a person is on their way out. It's often described as trying to get the last word in an
argument.
The name comes from the Parthian Empire, which existed during the time of the Roman Empire. Neither Rome nor Alexander the Great was able to conquer the Parthians. The Parthian calvary was what defended the empire for 500 years, and their special weapon was a small recurved bow. The Parthians developed a special tactic with their bows; they would attack an enemy force and then flee in full retreat, with the enemy following. With the enemy right behind them, the Parthians would turn in their saddles and fire their bows behind them, which was very effective. This became known as "the Parthian shot," and we know it as the "parting shot" when used in an argument today.