I think you are grossly underestimating how dependent both companies are on various open source projects. It's definitely true that they also do a lot of in house code of course; and they also contribute a lot of their own projects. And of course especially Google is a repeat offender when it comes to creating a lot of dead projects, reinventing the wheel, etc. It looks like their attempt to create their own operating system kernel is slowly dying now. Fuchsia is all but dead at this point. So they are back to Linux being their only future. There's the whole Kotlin ecosystem, which they helped create, which is starting to compete with flutter. And so on.