The battery may simply have reached the end of it's life as they cannot be charged up for ever, there comes a time when they can't hold a charge any longer and need replacing.
Another thing, it's life will be shortened if you leave it attached to the laptop for prolonged periods while the laptop is running off the mains adapter. Under those circumstances you are supposed to remove the battery and put it away somewhere.
If your laptop runs okay from the mains-adapter, it's time to get a new battery. Take care where you buy one from. Some are poor quality and fail after only a few months because they are cheap copies and not genuine original equipment.