Why do some women on the pill get pregnant?

I was watching the show "I didn't know I was pregnant" and the majority of the women said they were on the pill. So im confused on how this could be.