This isn't correct. GoodRx makes money by partnering with Pharmacy Benefits Managers. It's taking advantage of a loophole in the US's extraordinarily convoluted drug pricing system.
I think it is a little more than just a drug search engine. If you come to to a local pharmacy the price of a generic drug will $50, but if you show them the GoodRx referral with a price quote they will sell it for $5. Not sure what their relationship with the pharmacies are.