If you think of the design of pretty much any cannon up to the 1870s, it is a tube (the barrel), with a small hole drilled in it, known as the touch-hole. For a very long time, the way a cannon was fired was to load a measured charge of powder (usually in a fabric bag) and whatever projectile via the muzzle, or in some small cases through a screw-operated breech, ram it down to compact the powder and ensure the absence of a gap between the propellant charge and projectile. A large pin was then inserted through the touch-hole, piercing the powder bag, powder was poured into it from a flask, the gun layed (aimed), and a source of fire applied to the powder. At first, this source of flame was a slow match, but later advancements incorporated flintlocks and small bits of contact explosive, which slightly changed the manual of arms.
Spiking the gun was a fairly simple process; a nail or some other metal spike of sufficient size was hammered into the touch-hole to prevent the use of the cannon. To de-spike a gun, the nail or spike would have to be drilled out, a long and arduous process in the days before power tools and tungsten-carbide bits.
I was going to respond, but this previous thread covers it well