How do Credit Card Chips work?

Our credits card now have it – that little gold microchip that we use to insert into credit card terminals to make a payment. But how do these chips work, and how do they differ to the old fashion magnetic strips that we used to use?