The iPhone 12 contains an arrangment of neodymium magnets that are used to align and grab the "MagSafe" charger.
These magnets aren't present in earlier iPhones. As far as I know, no Android phone have these magnets either, but it's something that could easily catch on in future models.