The store chooses which credit cards to accept (at the birds-eye level, i.e., Amex, Discover, Mastercard, Visa), and the POS sends the transaction to the appropriate card processor based on the identifying digits in the card number (the first 4).
Apple Pay transactions are identified as Visa transactions, so Visa would handle the transaction...if the POS terminal is configured to accept NFC cards. Most older ones don't even have NFC functionality, and until 2 years ago even terminals with NFC functionality didn't have it enabled because they were shipped before NFC payments was a thing. Today, almost all POS terminals come with NFC payment built-in and enabled.
What's the deal with that? I've pretty much given up even trying to tap with my Amex because of how frequently it gives that message.