Google profits through ads generated from Android devices. Google has always been the company that profits mainly from advertising, never from selling hardware.
Nevertheless, Samsung ships their devices with Google Play Store (this is not provided free if i'm not mistaken). So there must be some money there also maybe per device instead of lump sum.