Why does a chicken lay an egg?

Why does a chicken lay an egg?