Why would adding a USB extension cord to my keyboard affect my Bluetooth connection to my magic mouse? Just wondering if some hardware guru can explain why this happens?  If I plug my full size USB keyboard into my Early 2013 MBP 13" Retina running Yosemite 10.10 without the USB extension cord it comes with, my Bluetooth Magic Mouse has intermittent problems, and can't pair.

But if I add the extension cord, then it works like a charm.

This took a while to deduce, and I was wondering how an extension cord can make a difference?  Any thoughts?
Are you plugging the keyboard into the USB 3.0 port? The signaling rate of USB 3.0 can cause RF emissions that can interfere with Bluetooth, WiFi, and other devices. Intel has a detailed paper on USB 3.0* Radio Frequency Interference on 2.4 GHz Devices

My suspicion is that the extension cable has better shielding than the keyboard's cable and moving the keyboard's cable just a little further from the chassis drops the RF interference enough for the pairing to work.

Try switching it to the USB 2.0 port. Does the problem go away?

Update: I struck out parts that don't apply to that model. I have the mid-2012 15" Retina which still had the USB 3 on the left and USB 2 on the right.