9to5Mac notes that CVS's payment terminals have had NFC capability for years; the company actually turned it off to prevent customers from using Apple Pay. This is because CVS was a member of Merchant Customer Exchange, which was behind a proprietary mobile payment format called CurrentC. Companies that adopted CurrentC turned off NFC payment capabilities in order to encourage adoption.
However, CurrentC was clunky to use; it involved scanning a QR code, which is much less seamless than Apple Pay's current system. As a result, it never established a large user base, and in 2017, JP Morgan bought the tech, which was its effective end as a payment system. In other words, CVS gambled on a payment system that didn't work and is now having to relent and accept Apple Pay.