Difference between USB connection and separate power supply?

I have successfully run various sketches that do Serial I/O on a Diecimila and UNO when not connected to a USB cable. This worked with a 9V 'wall wart" transformer, a 9V 'transistor' battery, a 6-cell (9v) AA battery-pack (all connected through the power jack) and a 4.5V battery pack connected to the 5V pin.