Software engineering is mainly knowledge work. This means the majority of work consists not of building stuff, but acquiring and organising knowledge. I've read somewhere that about 50% of the job is gathering information.
When a person leaves after having spent two years at a company, it might look like you get to keep everything they've been working on, but this is far from true. If the 50% assumption is correct, a person leaving after two years means you throw a full year of work into the dump. This is a huge cost, but it's hidden.
The code is there and (presumably) in source control. It really isn't that difficult for someone to get the source, compile it and fire up the debugger and carry on where the previous person left off.
There is so much implicit knowledge that goes into the finals source artifact that is not spelled out.
I had an interview at a this week for my next contract where they made redundant most of their employees as the business decided to just go with turnkey applications.
They will get someone like me in for 3 to 6 months to do application maintenance on anything they can't replace. This will be stuff like implementing stuff from penetration-testing, upgrading the applications and documenting missing bits and pieces and letting the business know what needs doing and where.
I don't need a pension being paid, no HR overhead (they can just ask me to leave whenever pretty much). I will be able to gleen enough from the business and their IT to piece the bits together. This is literally my bread and butter.
Who’s consuming the code? Who are the stakeholders? How does this component integrate into the full picture of the application? How do I need to talk to that person that I really need to change something?
However unless building the tech is the business you are seen just as a cost to the business in most circumstances.