The Magic Keyboard with Touch ID works with all Macs, but Touch ID only works with Apple Silicon Macs. This article teaches you how to connect a Magic Keyboard to a Mac, including all current models ...
You can connect a Magic Keyboard to your Mac through Bluetooth or using the Lightning port and charging cable.