Ovulation explained?

Can someone explain to me how you can get pregnant If you have sex 4-5 days before you ovulated?