The part in question (which is not a capacitor/condensor) is called a "vibrator" because it vibrates! It's is a sort of mechanical rectifier + step-up transformer, used to convert 6VDC from a (old) car electrical system to the high B+ voltage needed for the plate supply in the (tube) radio. If you google "radio vibrator" you can find a complete explanation.
They are readily available cheaply at antique radio parts suppliers, and are actually still being made.
Used in the shock machine because it was the easiest way to step up battery voltage to something that will give a shock, and because it can't source enough current to pose much of a safety risk (though it will definitely get your attention!).