When Nikon moved on from CompactFlash, they went to XQD. Nikon and Sony were the two original developers of the format, and initially only Lexar also supported it.
There’s a long history with XQD. Originally, SanDisk was one of the creators, but they bailed out to create CFast, which Canon adapted. Lexar ended up getting sold to the Chinese, and XQD sort of languished for awhile, with Nikon being about the only maker of consumer equipment using that format.
But XQD was indeed the correct choice. That’s because it was based on a standard that personal computers use for fast bus communications (PCIe). Over time, SanDisk and Canon came back into the fold, and CFExpress—commonly abbreviated CFe—was developed as the followup to XQD. Same pinouts, same card size, slightly better internal capabilities.
Curiously, Nikon cameras that can use XQD or CFe cards (Z6, Z7, D6) write faster to the older XQD. So, as I write this, stick with XQD cards. Not that CFe cards are bad, but there’s no reason to buy a new card yet (unless you’re using a Canon 1DX Mark III).