Let's do a little exercise: let's pretend for a second that a tablet is made by software (OS + drivers) and hardware (CPU, RAM, SSD, display). It's simplistic, but close enough.
Now, let's see how much is Samsung's cost in arbitrary units:
RAM: 0AU (they make it)
Display: 0AU (they make it)
And Microsoft's cost:
OS: 0AU (they make it)
Now, we can discuss how much is a AU and the relative weight of them, but it should be evident that both companies buy some components and build in house some others. Plus, let's keep in mind that the OS for Microsoft's tablet is not free for the HW division, as it has to be "bought" from WinDiv. In the end it all balances out at the corporate level, but the cost/revenue allocation is not a simple writeoff.