This is about the previous generation of Apple wireless peripherals. New ones can be easily paired when you charge them.
Remember that if you want to change the pairing of an Apple Wireless Keyboard or Trackpad to a new computer don't try it while you are nearby* the old computer. The old computer will always connect and the new computer will fail. Best to unpair (delete it from Bluetooth System Preferences) on the old computer.
*Nearby can be surprisingly far away.