1. the software doesn't have to have the source code available. It is called "proprietary software" and majority of people use it - Windows, macOS, iOS, and most of Android are proprietary.
2. the hardware, especially electronics, did use to come with "source code". I, for example, remember studying the schematics of my TV set so I could modify it and add composite video input. The ZX80 clone I owned had composite output already, so by bypassing modulator I was able to increase picture quality.
The same used to happen with the cars - there were full service manuals with detailed drawings and assembly instructions, precisely so one could change them.
3. In software specifically, the source availability has a very high practical value:
it helps to fix the problems. For example, I spent an hour yesterday reading source code of my CI system (Jenkins) to figure out if a certain thing was possible.
(this is why some companies which are jot ready for open source at least provide source code under "source available" model)
it helps with build process. Remember bad old days of Windows where your libraries cam in binary form and had to use right runtime / compiler version? This will never happen with SQLite, it even has "single file" version for super easy project integration.