Depending on which interfaces are provided by a M.2 connector, a specific form of the connection is used. These so-called keys require M.2 plug-in cards with recesses at certain points, so that only suitable plug-in cards fit into the respective M.2 connectors.
Most currently available M.2 SSDs are Key B + M. They have both recesses and can be plugged into Key-B as well as Key-M connectors. Buyers need to make sure the connector and module support the same key otherwise the M.2 card will not fit.
Quelle: wikimedia.org / NikNaks / CC BY-SA 3.0 M.2 can provide both SATA and PCI Express as an interface:
Key B: PCIe ×2, SATA
Key M: PCIe ×4, SATA
Overview of the maximum speeds of different interfaces
As mentioned above, M.2 can provide both SATA and PCI Express as an interface. M.2 SSDs connected via PCIe offer a speed advantage. PCIe 2.0 allows 5 GBit/s per lane, PCIe 3.0 allows 8 GBit/s per lane.