How does a whipped cream charger work?
The cream whipper relies on gas expansion to work.

When you make whipped cream by beating, you beat fine air bubbles into the cream. The cream traps air and becomes essentially a matrix that holds those bubbles--a foam.

Your gas-charged whipper does the same thing in a totally different way.

When you charge the whipper with gas, there's high gas pressure inside with the cream. The cream will actually absorb the nitrous oxide you put in. Because of the pressure, the gas absorbed can be thought of as really really really small bubbles within the cream. So you have a matrix of gas and cream, but because the bubbles are so small, it's essentially just cream. 

Chilled liquids more easily absorb gases at high pressure, which is why it's good to use cold cream and keep the whole unit in the fridge. A limited amount of agitation (shaking) exposes more cream to the gas, improving absorption.

When you release the cream from the device, the absorbed gas expands rapidly. The bubbles get bigger, and your cream to bubble ratio becomes more like the foam that we know as whipped cream. It's really exactly the same thing, only with nitrous oxide instead of plain ol' boring air inside the bubbles.

Why nitrous oxide? As I understand it, it's because it's the cheapest non-toxic, odorless and tasteless gas you can get. Carbon dioxide would almost be a good choice, but unfortunately it's bitter. Not a good match for cream.

Finally, why is shaking too much a bad thing? That one I don't know for sure, but I know what happens when you over-whip cream with the mixer. You make butter. Perhaps the gas or high pressure encourages this conversion, or maybe you're just churning it that much when you over-shake. Either way, I'm sure you've essentially made butter when you shook it too much.