To illuminate the keyboard of your Magic Keyboard attached to an iPad, go to Settings > General > Keyboard > Hardware Keyboard and adjust the keyboard brightness slider. If the slider is disabled, ensure that the Keyboard Backlight Control is added to your iPad's Control Center