We use the expression “to spike one’s guns” now only in its figurative sense, to deprive one of his power, to make one’s authority or arguments valueless.
Its literal sense amounted to exactly the same thing, for the expression arose back in the seventeenth century and earlier when guns were fired by igniting the charge at the touchhole.
If the touchhole were blocked, the gun would be rendered entirely valueless.
And as the guns of that period, especially the siege guns, were extremely unwieldy affairs, almost immobile once they had been dragged into position, and had a comparatively short range, a sudden sortie by those under siege, if successful, would drive off the gunners.
A nail or spike driven into the touchhole then destroyed the menace of the guns.