Universal Serial Bus (USB) ports are a fundamental part of a computing setup, giving you the chance to connect peripherals and accessories like keyboards, mice, gaming controllers, graphics tablets, ...
You can connect a Magic Keyboard to your Mac through Bluetooth or using the Lightning port and charging cable.
It's not uncommon for USB ports to stop working properly, and there are several common ways to resolve any issues.
USB ports began development in 1994 with the goal of creating a universal connector to replace the multiple standards used in computers of the time. Since then, USB ports have evolved significantly.