The closer you charge to 100% and discharge to 0%, the more quickly the battery's capacity will degrade over time. If you keep the discharges shallow, you can increase the battery's longevity 5x to 10x.
http/batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries
When you charge/discharge the battery, you're actually causing tendrils to change physical shape. They grow and fatten up as they charge up (trying to find a video). The closer you charge to 100% (or discharge to 0%) the more physical damage you cause to the tendrils. And the less charge they can hold. Edit: found the video.
http/www.popsci.com/science/article/2010-12/lithium-ion-batteries-swell-and-contort-while-charging-new-study-shows
The problem with leaving the battery at 100% is that Li-ion batteries slowly self-discharge. Many older laptops would charge to 100%, stop charging, self-discharge to 99%, charge back up to 100%, stop charging, self-discharge to 99%, etc. This repeated charging to 100% every hour or so rapidly wore out the battery (the Toshibas were particularly bad about this).
Most newer laptops have adopted several strategies to combat this, especially since non-removable batteries have become the norm. I've seen some or all of these on newer laptops.
■They won't start recharging until the battery's charge has dropped to 95% or 90%. So if you leave the laptop plugged in, it will only top off to 100% every few days. It's still damaging the battery, but because it's doing it once every few days instead of every hour, the damage doesn't significantly degrade the battery for several years.
■You can configure the laptop's charging software to limit its max charge. So if you set the max charge at 80%, the laptop will stop charging when the battery reaches 80%, instead of 100%. My previous laptop could do this, and I immediately capped it at 80%. 4 years later when I replaced it, the battery still lasted almost as long as it did when new, despite being plugged into AC power almost the entire 4 years.
■Some laptops are designed so the battery mis-reports its capacity. So it's a 44 mAh battery, but it reports its capacity as 40 mAh. So when the laptop thinks it has charged the battery to 100% and stops charging, the battery has actually only been charged to 91% of its capacity. Hardware reporting software like HWInfo will often detect this as battery wear (difference between stated capacity and current capacity). My current laptop reported 5% wear (95% full capacity) when the battery was new. It's been plugged in most of the past year at 100% charge and it still reports just 5% wear.
So if you've got a laptop which doesn't use any of these strategies, then I would manually try to avoid charging it to 100% (especially if it tops off immediately at 99%). But if it's a newer laptop, you're probably just fine with it at 100%. Just discharge the battery at least once a month (not to 0% - that is as bad as charging it to 100%). Maybe once every 4-6 months do a full discharge (Windows will probably auto-sleep at 5% - that's good enough).