In Roman days, craftsmen had trade secrets and no patents. If you lost the trade secret for whatever = your monopoly was broken. Slaves employed in secret crafts were unable to write and well guarded.There was no IP as we know it. This carried on until widespread printing and reading permitted easy IP spreading - and letters patent = a king granted monopoly that evolved into the early patents - to-day's melange. Copyright on writing evolved to life of author - until Disney came along.
Software jumped onto writing's coat tails.