Morning sickness.

Does anyone know the reason why when you're pregnant you get morning sickness? And how long does it last. Does it last until you have the baby? It sucks..