Most likely there is a short of some sort in one of the cables or devices resulting in a loop. The shorts have 0 resistance, so it is trying to draw more power than USB ports are designed for and can safely put out. USB ports supply 1 amp of current at 5 volts, resulting in 5 watts of power. If any devices tries to exceed that, your computer will cut power to the ports for both safety, and so it doesn't drain your battery. Check your cables, the dock connector on the iPhone, and inspect the keyboard.