How quick does your body take to realise you're pregnant?

How long does it take your body to realise you're pregnant, because say if you had sex 5 days before your period but for pregnancy tests you have to wait like 2/3 weeks for it to show up how would your body know for your period not to come that week?