When you install the software, the license key comes from the computer (it's stored on the motherboard), or potentially typed in by the user, not from the disc. The discs don't work if you don't have your own key.
Distributing the discs is copyright infringement, but the penalty is proportional to lost revenue. MS didn't really lose any money from this but they claimed that they did.