99.9999999% of software written is not published, it’s covered by trade secret law. Copyright only applies to published works. Look into what happens legally when source code is leaked and published.
If copyright applies only to my published works, this would mean as long as you steal my laptop you now own the works on it. I'm certainly not publishing my diaries on the internet.
This has not been true for a very long time.