MagSafe is a magnetic technology from Apple, built into the internal engineering of iPhone 12 models and the newer iPhone series.
It was initially created as a safety feature for MacBook charging cords, MagSafe was incorporated into the iPhone 12 to create a new ecosystem of accessories for easy attachment and faster wireless charging.