Android is technically "open source and free", but all the profit from the Play Store goes directly to Google (i.e. The 30% from app store purchases completely skips OEMs like Samsung and funnels entirely to Google).
Hence, why they're willing to offer the OS for free and why they push so hard for it. They make far more money from app purchases.