An A/B switcher allows you to connect your guitar to two amps, switching between them with a footswitch. This is useful if you have an amp that you like for your clean sound, and a different amp for your dirty sound. Many A/B switchers have a third option that connects your guitar to both amps at the same time. This is really useful in achieving a "big" guitar sound, as the responses of two different amps will combine in unexpected ways.
There are two kinds of switchers. Simple switchers have three jacks and a footswitch or two. Some of them add a battery and status LEDs. These simple switchers connect the grounds of all three jacks together. Isolated switchers use active circuitry and a transformer to "float" the ground of one of the output jacks.
What's the benefit of an isolated switcher? Some pairs of amps won't work well together with a simple switcher, because of ground loops. An isolated switcher prevents the ground loop.
The slight current that leaks from the power transformer primary to the chassis goes harmlessly to ground via the third wire of your power cord. The slight resistance of the cord causes a voltage drop, and the amp's chassis isn't at exactly the same voltage as the ground at the wall outlet. When you hook two amps together, you can get some ground current flowing in the signal leads as well. This causes hum.
You can tell whether this is going to be a problem if at least one of your amps has two inputs on a channel. Plug your guitar into one input, and run another guitar cord from the second input to your other amp. If you get hum when you connect the second amp, then it's going to be a problem when you use an A/B box.
The only safe way to get rid of that hum is to use an A/B box that has an isolated output. These are more expensive (in the $200 range, compared to the $40 range for a simple A/B switcher) because they have active circuitry. The ground of one of the amp outputs is isolated from the other grounds on the box, so no ground loop current can flow through the signal leads.
Don't use a ground cheater or clip the ground prong off your power plug - although recommended by certain "experts", defeating the safety ground can be dangerous.