There are many reasons that it fails, although missing a dose is the largest reason. Other reasons can be improper storage, using certain drugs (prescription or otherwise), or even consuming an unusual amount of some foods or supplements. Even if you do everything right there's a small chance that it will happen anyway.
Now, people like to claim that if you skip a dose or mess up taking it at the wrong time of the day it's your fault, but it can be complicated due to the different types of pills available, and if you get switched to a different brand, it can be easy to mess up. Typically pills come in a 28 pack. The first 21 or 24 of those will have the hormones used to prevent pregnancy, and then either 7 or 4 will be placebos. But some schemes only give you 21 pills and then you go a week without taking any before starting up the next set. There's also now larger packages and the hormone concentrations and days without taking them vary as well.
Condoms have certain advantages, but they break. And other forms of birth control tend to be more expensive and out of the reach of people living in poverty.