A magnetic lock or mag lock consists of a large electromagnet installed along the top of a door frame and a metal plate on the door that lines up with it.