They're paid to work on FOSS projects. Gnome isn't a RedHat project. Nor is the kernel. And they're IBM projects even less.
And most of those projects started without RedHat and RedHat stepped on them to become what it is first. Plus, there are thousands of essential projects they don't have anything to do with, still in the distro.