Please read this article to make sure you are using the correct connection path.
Additionally, you must verify that you are connecting your keyboard with an authentic Apple adapter. Third party adapters will not work. There are 3 kinds of Apple adapters that will work.
- Lightning to USB Camera Adapter (for iPads with Lightning ports)
- USB-C to USB Adapter (for iPads with USB-C ports)
- iPad Camera Connection Kit (for iPads with 30-Pin ports)*
*Apple no longer manufactures this adapter. You should be able to find it by searching the internet for "Apple iPad Camera Connection Kit".
Please read this article for common troubleshooting solutions.