This would depend on the bike brand. Some batteries work with smartphone apps which will tell you the number of charge cycles as well as the battery "health".
You can also look for minor scratches or marks on the battery case which can be an indication of use.
I don't think this really matters as long as the battery meets it's capacity ratings and hasn't obviously been abused.
On some batteries, including the ones I have, the BMS puts them into sleep mode when not used for extended periods. They "wake up" when connected to the charger.
Does the bike come with a warranty? If so, a defective battery should be grounds for a replacement or even the return of the entire bike.