Lithium Ion batteries have built-in circuitry that controls and monitor its charge and discharge. The laptop just supplies a stable source of current for this circuitry to do it's job. Batteries will go bad as they age whether the laptop is left plugged in or not. Remember you get what you pay for. Buying cheap generic batteries are a crapshoot. You might get one that only lasts a few charge cycles.
Follow these tips to prolong your batteries life.
Laptop battery tips