Upside down world.
Maybe you should habve titled this: "How OpenSource provided the underpinnings for two very successful companies".
Apple is based on BSD. Channel Steve: Without BSD, neither MacOS nor iOS would exist.
And, TTBOMK, FaceBook builds heavily on top of opensource.
Whether building walled gardens inside the set of capabilities that are freely available is ethically sound, is a different question. At any rate, the walled gardens are only the icing on the cake.
Whether some of these will endure is a completely separate topic too. Personally, I find BlueGene (also built on an OpenSource foundation) to be a more valuable contribution to the world than either Apple products or Facebooks. And I don't see walled gardens providing solid foundations for anything.