A:Answer Hi there,
Yes, the Apple Magic Keyboard is compatible with the iPad 9th gen, 10.2". It has the same Smart Connector that is used to connect to and power the keyboard.
However, please note that the Magic Keyboard is designed for the 11-inch iPad Pro and iPad Air, so there will be a small gap around the edges of the iPad 9th gen, 10.2". This does not affect the functionality of the keyboard in any way, but it is something to be aware of if you are considering purchasing this keyboard for your iPad 9th gen, 10.2".
I hope this has been helpful!