Forget "money," think "value," which is what really matters in capitalism. BobCo received value from the previous OSS programmers in the form of free code. BobCo then makes some changes and additions (which have value). BobCo then gives that value away, but is probably still ahead, since most likely it received more value that it gave.
In the closed-source model it's reversed. BobCo gives value (money) to get a license to modify and resell software, but keeps value in its modifications.
Now BobCo redistributes. JohnCo does the value thing the same, getting and giving value with its use of the original and additions. Now BobCo downloads JohnCo's improvements to its code. BobCo just received value again because somebody else improved its additions to the software. The only way BobCo was able to receive that value a second time was by giving value initially.
All companies benefit since they spend less time solving problems that other companies have already solved. Imagine if every company had to write their own indexing software instead of simply using a package, like Lucene.