Put another way Numbat the copyright law might protect someone from taking your code and copying it, or copying a derivative work from your code.
With patents the code isn't really the important thing, it's the way the code works. This protects you from writing code based on another person's great idea without ever referencing their code.
e.g. Microsoft might write some incredibly well thought out and effective way of doing clustering in their SQL server database which took ages of R&D. They're worried about Oracle seeing what they're doing and just redoing it without the R&D cost. Copyright law can't protect them (except perhaps some EULA clause on reverse engineering of questionably enforceability, especially since the MS person may well write a paper on their new system because it can't be protected as a trade secret)
Another example are audio/video codecs. Anyone can implement them, you can create new ones without copying anything, but the exactly details of how they work is very intricate and took a lot of development time. (The MPEG-LA is the only group which my company pays patent royalties to, and not for any software but just because we use their algorithms)
This is a controversial patent for Wifi: http://www.google.com/patents/US5487069?printsec=drawing
Lots of commentators said "patenting Wifi, that's absurd there was prior precedent and it's non original etc, and who can parent something so vague", but if you look at the patent itself you'll see it's very specific and detailed.
I saw an interesting lecture on software patents recently and their relation to the open source community (which I unfortunately can't find), where he made the important observation that to be immune to a patent you need to go to the list of claims in the patent, and just show that your device / idea does not meet that claim. Therefore the patent is immediately invalid.
The take-away from that is that patents have to be very specific, and you really have to match the patent exactly. They're only really useful when there's just one specific right way of doing things.
There are exceptions, like anything there are those who abuse the system, but on the whole I don't get the furore about software patents so much.
I think EULAs, which are basically contracts (which have held up in court) which can contain more or less anything and usually give protections far above copyright law, can be much more questionable
IANAL so you may disgree, it is an interesting area though and one which I have to tangle with more often than I like.