Just personal experience. Apple doesn’t address this specifically in any support articles. There is also a limit on transit cards. I know they were limited to 4 cards before iOS 16. I don’t know their current limit and if it changed. So, an iPhone 7 may have 8 credit cards and 4 transit cards, for a total of 12. Apple >cards< count. But Apple Pay Later >card< and Apple Account >card< don’t seem to count. I currently have 17 cards in my Wallet. I got to 17 when I added an Apple ID Account. But before it was added I couldn’t add anymore credit or debit cards.
I suspect the Secure Enclave was changed after iPhone 7 and the firmware/software was changed with iOS 16. This was widely discussed when 16 released September 2022.
I haven’t found a limit for loyalty cards and passes. My wife must have 50 or more loyalty cards in here wallet and no end in sight.