It's blind luck. I've had between one and four memory cards fail on me every single year for the last ten years (bear in mind I go through about 2000-10000 frames per week for work, then add on whatever for personal/hobby shooting) and there's been no one brand or type of card which has lasted longer than others. SDs, CFs, CFast, XQD, Micro SD, they've all failed on me in a variety of ways. Lexar, SanDisk, Transcend, Sony, Samsung (yes, Samsung used to make more than just micro SDs and SSDs), they've all gone rogue.
For that matter, I've had two mechanical drives and one SSD fail me in the last year; two Seagates and one Samsung.
If we were going to go through every USB flash drive that's failed me then I'd be typing all night.
The only time I have ever experienced a consistent failure with a specific brand or format was a trio of Transcend SD cards back in 2011. One of them failed and around twelve hours later Transcend put out a statement that they had identified a faulty batch and users should send back any cards with a certain range of serial numbers, for free replacement. The card I had fail was one of those and there were two others which I hadn't even used yet but were also within that serial number range. I sent all three back and within the week Transcend had sent replacements. Of course, being just 16gb SD cards back in 2011, I had a truckload of them sitting around anyway so it didn't really affect anything, but still. That is the one and only time I can say I have come close to identifying poor reliability with a particular brand/form and even then, two of those we just assumed would follow suit.
There's cheap off-brand cards which don't reach their advertised speeds, don't have their advertised capacity, and do fail more often. Weird stuff with names you've never heard of sold at £10 for 2TB card. Those things will fail you more than others. But any of the brands that have big enough production that you've heard of them? They're all about the same in terms of reliability. No brand and no form factor is tougher than any other. If you think you have found some secret recipe for an extra-tough/weak memory card, I'm willing to bet that just means those are the only cards you've even tried and you've been uncommonly lucky/unlucky.
FWIW my 'default' kit bag contains, on purpose, a mixture of cards of different manufacturers and different speeds specifically so if there is ever a failure with more than one card at the same time, I can automatically rule out the possibility that it's down to a specific brand or type of unit. This comes from 2003-2006 1D cameras which had 1 CF card and 1 SD card slot, forcing you to use different cards so if one card was genuinely faulty, the second probably would not be affected. To this day I'd rather more cameras had a mixture of formats than matched pairs; still, even just mixing brands and production years of cards should minimise your risk.