Typically, a person who receives a state pension will have made 35 years’ worth of National Insurance contributions. But there will always be people who have not reached this milestone and will therefore miss out.
You might have been off work for several years because you had children or caring responsibilities. Or perhaps you lived overseas, or were recovering from an accident or illness and were unable to work as a result.