Laptop batteries last 2-3 years in many cases. Their lives can be prolonged by regular calibration periodically . . . to include before 1st use. Most people don't bother with that and they end up replacing them.
It is also possible that the charging circuit can go bad on the laptop's mobo, but odds are it is simply a battery dying of old age.