2-3 years is typical, for an e bike battery that is used and stored in the real world. It's not ridden everyday usually, and not ridden for months in winter. In summer, its in a warm place, and full so you can ride anytime, especially if used daily in summer.
Because a stored battery with a bms can sometimes discharge itself while in storage, most people should top off a battery in winter storage about monthly, or at least verify that its not discharging fast enough to matter. Leave it plugged in on the bike, ignore it for 6 months, and likely you killed it.
For serious long term storage, then somehow disconnect the bms. Then store colder than room temp, charged to 80% or so.