BIrth control question

So if you take birth control and have unprotected sex, can it still cause you to get pregnant? I'm new about birth control and what it does to help our body. Help?