Looking after the battery in your device is often overlooked. There is so much conflicting information of how to care for your battery online that it is often difficult to work out what is best.
The way i look at a laptop battery is it is just a larger version of your phone battery. Would you use your phone all day plugged in? Also just as bad is leaving your laptop battery discharged for long periods of time.
The new lithium-iron batteries in all new laptops and for the past few years suffer with the swelling affect, and as they are internal and not user replaceable, if left swelling they not only could pose a fire risk, they also could cause other internal damage. Older laptop with easy access batteries are housed in a hard plastic case and tend to stop charging all together before anything serious happens.
What i recommend is to use your laptop more like a phone, Charge it to 100% and then use the laptop without the charger connected.
If turning the laptop off for a period of time, do so when the battery is near 100%.
If your battery is down to 20% but you are still using it then put back on to charge and repeat.
With new laptop advances, batteries in new laptops can last anywhere from 4 to 12 hours!
The main thing to take away from this is if you are noticing the battery is not performing as it should, consider having it checked or replaced as a precaution.