Magic Keyboard is generic name used by Apple to market a whole family of Apple keyboards. I presume that you refer to the Magic Keyboard for iPad?
The Magic Keyboard for iPad is specifically designed for the 2018/2020/2021 models of iPad Pro - and the 2020 iPad Air.
Unless coupled together, the Magic Keyboard cannot communicate with the iPad.
The Magic Keyboard for iPad does not connect wirelessly - but instead connects to iPad electrically using the Smart Connector - this being three contacts on the back of the iPad and Keyboard. The Magic Keyboard for iPad has no battery or internal source of power. Magnets hold the iPad in physical contact with the Magic Keyboard - ensuring that the iPad is aligned with the Smart Connector contacts.