You do. On payment, the rights to the software developed for you pass to you, recorded in the contract and not sold as an add-on. You receive the source code, the database structure, the instructions from which a running version can be produced, and access to everything needed for operation.
This handover runs alongside the project from the first day. The source code sits in version control to which you have access from the start. If you break off the project, you keep everything built so far, together with the instructions for carrying on.
What does not belong to you we name in advance: libraries used remain under their respective licences, purchased components remain with their manufacturer. We keep these components in a list so that your legal department can review them before anything is signed.
And in case you no longer want to work with us: another company must be able to take over the application without having to ask us. That is why we write the documentation for the successor. At handover we check that it serves that purpose: a developer from outside has to be able to build and start the application from the documentation alone.