Apple's iPhone 12 models have a built-in ring of "MagSafe" magnets that make them compatible with magnetic accessories like cases, chargers, and wallets. Apple makes MagSafe accessories, but third-party companies are also able to design MagSafe products.
As highlighted on Twitter, Apple has an Accessory Design Guideline [PDF] that goes into great detail on the kinds of magnets accessory makers can use, the orientation, and other design specifics Apple is requiring.
Cases that have a MagSafe magnet, for example, must enclose the device, have a maximum thickness of 2.1mm, and must firmly attach to the device without relying on the magnets, which means no magnetic snap-on cases that won't otherwise stay attached to the iPhone.
Apple's own iPhone 12 ad has a scene where a case appears to "click" on using the MagSafe magnets, but first and third-party cases in reality don't work that way, and Apple doesn't intend them to.
The design document is extensive and has specific placement, dimension, and polarity instructions so that all MagSafe accessories can magnetically self align "within a 1.55mm radial maximum. Cases with magnet arrays must not interfere with either wireless charging or magnetic stripe cards in an attached iPhone Leather Wallet, and Apple has special testing protocols for vendors to use.
There are also recommended magnet array vendors and requirements for the magnets used, with Apple requiring them to be N45SH NdFeB with a 7 μm - 13 μm NiCuNi plating finish. Magnetic force required to dislodge a MagSafe accessory has specific guidelines. Apple says a case attached to an iPhone 12 should take a minimum of 800 gf (gram force) to dislodge and a maximum of 1100 gf.
Accessory makers that want to have a label that denotes their accessory as a MagSafe-capable device must comply with Apple's guidelines. Those interested in reading more on Apple's guidelines can check out the full PDF document.