The answer is copyright. If Alice, Co. produces a program, they presumably have the copyright on it. If Bob, Co. copies it, that's a violation of copyright, and Alice, Co. can sue over that, for damages and an injunction to stop Bob, Co. from further copying.
In the US, damages come in various kinds, but it's normally possible to sue for any harm Bob has done. There are additional things that Alice can ask for if Alice has registered the copyright on the program. (By the Bern Conventions, which most countries have laws conforming to, copyright exists without registration, but in the US there are benefits to registering.) It may or may not be possible to sue to recover legal costs.
The court order to stop doing that may be more important, if that's one of Bob's business strategies.
There are other possibilities I'm even fuzzier on. All disclaimers apply: I am not a lawyer, I don't even know what jurisdiction(s) you're talking about, this is not legal advice, I take responsibility for no consequences of following it, and relying on what I say in court or in other serious legal doings has an excellent chance of getting you what you deserve for something stupid.