"Stealing" code is copyright infringement, which is obviously avoided by most legitimate companies. Losing a copyright infringement suit can easily destroy most companies. On the other hand, without patents, reverse-engineering and feature-matching is perfectly legal and done all the time. Some unethical companies can very well be doing the former whilst pretending to do the latter, and this is where access to the source code lets them do that easily. But as soon as these companies become big enough and of consequence, they quickly clean up their act - DivX being a prominent, closed-source example, where it's suspected that the initial release was based on infringing Microsoft's source code.
Therefore it highly depends on how visible and active those FOSS projects are. It's important to remember that not all FOSS projects are Linux, GCC or Mozilla, and it also depends on your adversaries.
- Large and active projects are practically immune; their tremendous goodwill and visibility makes it very risky to "steal" from, and their pace of development makes it hard to out-compete them regardless.
- Medium-sized projects can suffer but the damage is limited. The reason is, again, if unethical competitors get large enough, it also makes them more attractive targets of lawsuits, so they either stay small or clean up. For example, FFmpeg - a suite of FOSS audio/video codecs - is a popular target of copyright infringement. Although most are minor infractions of their (L)GPL licenses, no doubt some are blatantly infringing.
Small projects can indeed be undercut. If the market is small enough to stay under the radar of lawsuits, an unethical company can easily claim the code as their own, release a closed-source competitor and crowd out the market through providing superior value. Here's an example:
A competitor [to DikuMUD], at the time, also had based theirs on the same codebase, and they opted to blatantly ignore the copyright, rip out all traces of it, and basically lie to everyone including themselves. Their logic was "none of the original code exists" and "we have done massive rewrites and improvement" and generally ignoring the fact that they started with 20,000 lines of code. They were charging for items in the game, and making too much money to stop.