When you remove the keyboard that comes with your iMac from the accessory box, you'll see the iMac documentation packet. You can find the Lightning to USB cable beneath the documentation packet.
The cable looks like this:
Use the cable to connect and charge these Apple accessories that might have come with your iMac:
- Magic Keyboard
- Magic Keyboard with Numeric Keypad
- Magic Mouse 2
- Magic Trackpad 2
The accessories included with your iMac vary depending on your computer's model and the options you chose.