Firstly, I am not a lawyer so you really should get proper legal advice before signing any contracts!
With that out of the way, I’ve written two answers for you, the first one here is long and slightly rambling, the second (below, just skip to the next post) is the short answer to it all. HTH.
There are a couple of issues to deal with. Copyright is automatically (i.e. you don’t have to do anything) granted on any original works. Yep, that’s right, you don’t do anything. AFAIK all western countries have a deal where they’ll happily allow any copyright. Notable exceptions are (or perhaps were) China and Russia. Although Russia are now getting their copyright laws sorted out, not sure about China (or in fact a lot of other countries).
Separate from that is the issue of patents (which you do have to apply for) and trademarks (again, you have to apply for them). Patents apply to a particular process to achieve some result (but IMO software patents are teh suxx0r). Trademarks are when you register some sort of phrase or image or something as your own, I can’t think of any off the top of my head, but there’s also something in law that says once a trademark becomes a general part of everyday language then it’s no longer a trademark. But you’re better off Googling to find out more. (see what I did there :))
Now, back on topic, when you go to a publisher with your game (at least in our experience of indie game development) the publisher licenses the right to publish your game in the territories they specify, and also by what means they specify. E.g. if the contract says EA (for example) can publish your title in the USA via the retail chain only, then they can’t sell online, they can’t sell to outside the US, etc etc. You could get another contract with (e.g.) Snowball for the Russian territories which runs simultaneously to the EA one, but that’s ok because they’ve only licensed it for a specific territory. Some publishers will open with offers that basically say they get the license for the world, via any media, for an unlimited time, which are generally bad deals unless you’re getting a shed-load of cash. Remember, publishers will try to screw you, they will want to give you almost nothing and expect to get everything.
We’ve recently spoken to some publishers that have wanted to take our game for no up front fee and a pathetic royalty, and frankly it was insultingly bad. Specifying an up front fee is good if you can get it, at least it means you get some cash straight away, and it indicates some sort of motivation on the part of the publisher. We’ve heard of publishers signing deals for games based on royalties only, but then they’ve not bothered doing anything with the game for ages, or they’ve not put any marketing effort into selling the game. At least if the publisher is forced to pay out money up front then they’ll want to get that money back (at least), so might put some effort in (well, that’s what we assumed anyway, who knows what they’re thinking ;))
One issue that’s linked to copyright is that of intellectual property. For example, if you make a game featuring a ninja teddy bear called Akira (work with me here), then the game itself can be licensed to publishers and so on, but you still own the character of Akira the teddy bear, and no other companies or individuals are legally allowed to profit from that character. This is all good when you come up with a popular character that you can then merchandise the hell out of (Lara who?). But watch out for publishers that try to sneak contracts past you that include them getting all rights to the IP associated with the game. I’ve heard of it happening (all too often), and the developer of the game just gets screwed over at the end of it.
That’s certainly not everything, and, as I said at the start, you really should consult a proper legal person for the definitive answer, but this is how I believe everything works (I’d rather be playing with my rendering code than doing law stuff, so please understand if I’ve missed anything ;)).
Ultimately it’s your decision as to whether you’re willing to sell your rights and IP to the publisher. If a publisher was willing to give me a couple of million quid up front then I’d probably sell out in a nano-second ;), but it’s worth remembering that you don’t have to give them everything to get a deal regardless of what they’ll try to tell you.
HTH.