Short answer
The contract decides. In custom development contracts it is usually agreed that the client gets the rights to the system and its source code, or a broad licence to use and develop it. This must be written clearly into the contract, along with access to the code, documentation and the licences of third-party components.
What to put in the contract
- Copyright or licence — do the rights to the code pass to the client, or is a licence granted, and to what extent?
- Access to the code — where the code is stored (the repository) and who has access.
- Documentation — what will be handed over together with the system.
- Third-party components — open-source libraries and their licences.
- The developer’s reusable modules — how they are licensed.
- Data — the data always belongs to the client.
Why it matters
If the rights aren’t clear, problems can arise when changing developers, selling the company or bringing in investors. If the code isn’t accessible, only the original developer can develop the system.
An off-the-shelf product
With off-the-shelf software you usually only get a licence to use it, and the code belongs to the vendor. That’s one of the differences — see off-the-shelf or custom system.
This is not legal advice — it’s worth having a lawyer look at the contract.