What data is on a credit card magnetic strip?

Why do credit cards have a magnetic stripe on the back