A handy little guitarists' toy. It's a little box, usually made of metal, with one or more switches on top and two or more 1/4" mono jacks on the sides. The switches are the kind that you push in to close the circuit, and then push in again to open the circuit: "Switch on, switch off".
The box and the switches themselves are usually rugged, because of course you step on them with your feet.
The purpose of the thing is to control features of a guitar amplifier or other musical gear -- or to re-route a signal from one place to another. When you've got both hands busy playing, all that's left is the feet. You might want to switch your guitar between two amplifiers to play a solo, or to get a different sound for other reasons. Your amplifier might have a switchable gain boost or multiple channels, so you could do the same with only the one amp.
It's very common for guitar amplifiers to provide a mono 1/4" jack on the back of the chassis to switch the reverb, another for tremolo (if the amplifier even has that; it's getting all too rare...), another for distortion, etc. It's a very simple, elegant, and robust way of doing things. Mono 1/4" jacks are standard; everybody's got a dozen cables with one on each end, and everything uses them. They're a lot like standard input/standard output in most operating system environments: Keep it simple, keep it consistent.
So there are really two semi-distinct usages here: In one case, the musical signal itself is passing through the box and being redirected; in the other, the switch in the box is just opening or closing a circuit that turns something on and off. You use the same cables for either; see "simple and consistent" above.
Some foot switches just open and close a single circuit; I've also got one that switches a single input channel back and forth between two outputs. My amplifier has two channels, so I can set one channel louder than the other and switch to that one when I need more volume.
Most primitively, a foot switch is just an ordinary switch with 1/4" mono input and output jacks and some wires soldered from one thing to another. This isn't ideal, because you get an audible click when you work the switch. The manufacturer can throw in some electronic fiddle-faddle to reduce that.
Nowadays, in these decadent modern times, some foot switches are much fancier: They've got MIDI switches and all manner of newfangled nonsense. Sometimes they're even made of plastic. There's no accounting for taste, I suppose.
The way these things are stored is in the bottom of a milk crate underneath a pile of coiled and tied 1/4" cables of varying lengths (some with an impedance pad on one end), assorted stomp boxes (most of which still work), loose cable ties, a couple of cheap microphones, and whatever other random detritus crept in there to die since you last played.