The original USB standard was (is) indeed for 5V, at a maximum 0.5A, for a total of 2.5W. There is no logic involved--just connect to the pins and draw power.
As the USB interface has grown in sophistication through USB 2.0, 3.0, etc., options to draw more power from the interface have been...