The switch is a simple ON/OFF switch, enabling power to pass into the circuit from the battery pack / DC barrel jack (since they're wired together).? The battery only works when something is not plugged into the barrel jack.? Battery is the battery pack, and DC J1 is the barrel jack.? The USB powers it without the switch, because it is feeding the voltage directly from the arduino, skipping the power input (battery/jack, switch, polarity protection, voltage regulator) altogether.
I'm going to do my best to explain this, but I usually am pretty bad at teaching.? So...
Power comes in from the PIN on the barrel jack (DC J1, pin 1), and ground is the barrel sleeve (DC J1, pin 2).? Power goes in, through D1, which as a diode allows current to pass in one way only (preventing you from blowing the circuit from powering it in reverse).? This then goes through the On/Off switch (SW1A), which blocks the circuit (off), or allows it to pass (on).? The current goes into U1, a linear power regulator that outputs 5volts.? From here, the current goes off to the various components.
The battery pack is wired in parallel (as opposed to series) with the DC power jack.? If nothing is plugged into the power jack, then voltage flows through D2 to the switch (same as in the case of the power jack), but the main difference here is the battery's ground side.? The negative side of the battery connects to ground (Battery1, pin 1), but does so THROUGH the barrel jack (DCJ1, pin 3).? If nothing is plugged in, pins 2 and 3 are grounded together, and thus the circuit is completed.? If something is IN the barrel jack, then pin 3 is forced away from pin 2 (ground), and thus breaks the circuit from ground, and the current can no longer flow.? This effectively cuts the battery out of the circuit whenever you power it from the DC jack.
Someone smarter than me should be able to explain it much better, but I hope I helped!? I highly recommend Grob's Basic Electronics, as well as Sparkfun electronics' learning pages.
~Josh
W0ODJ