This thing is same for all commodities considering research,advertising,employee salary. Apple is epitome of technology and innovation. This is what makes it Premium and thats why customers pay hefty price to use their devices.
Remember that Facebook, Google earn money through advertising while Apple earns money through selling products. Apple has a much higher revenue as a result.