How did my school do this to their Wi-Fi?

This is all I know: my school has multiple Wi-Fi spots throughout the buildings with different names. They have a same-named one everywhere but requires a password. But the others when I try to connect tell me I can't. I get some type of error on my iPhone. With school laptops they work fine. I'm just curious to know how they did that.

Every network device has a unique id, the access points are probably configured to only allow specific IDs connect, the IDs of the school laptops.

Yes, a they can use mac filtering. The other thing it might be is a client cert, which registers the device. There are several authentication methods that use a client cert (EAP-TLS is one).