Most programmers do approximately zero work that is R&D. The most you lose if they walk out the door is institutional knowledge.
On the other hand, I've worked almost exclusively on software R&D for decades and seen the loss of a single person effectively end a project even when the software was essentially finished. Software R&D is about developing abstract knowledge, concrete implementation code is just a useful byproduct of that since R&D is typically motivated by a specific novel requirement.
If the software IP that results from R&D is not core to your business or a competitive risk, there is money to be made by licensing it. I've licensed this type of IP to big tech companies a number of times. If you are not actually doing software R&D, you are unlikely to be in a position where this is a possibility.
In almost every IP sale and licensing deal for software R&D I've seen, the value of any code is almost entirely conditional on retaining the services of person(s) that designed and wrote it. The entire "acquihire" phenomenon is an explicit admission of this. This is true even when the code is in a mostly finished form. Companies are buying capability, not revenue, so the code can't be a black box to their engineers. Companies usually spend more to acquire people with the code knowledge than the actual code.
The practical reality is that it is difficult to reverse engineer abstract knowledge from a concrete implementation. No one wants your code per se, they want to adapt your code to a different application that requires having a deep understanding of the domain the code represents -- they don't know what they don't know.
If you are just grinding out software that could be vibe coded then there is minimal asset value being created in the software artifacts. Anyone else would be better off reimplementing it themselves.
So yes, almost all of the value of code produced by software R&D vests in the people that wrote it. This is evident across many software IP transactions.