There’s a few aspects to this, to the best of my knowledge.
When you sleep the Steam Deck, power to RAM is maintained but not to other components so it will quickly resume where you left off.
If you shut down the Steam Deck, the batteries will still slowly self discharge which is an intentional design to help the overall lifespan of the battery (future charge cycles).
The Steam Deck does have a “storage mode” that fully disconnects the battery and disables discharge which is predominantly designed for use when either doing repairs (don’t want to get shocked or damage components as the battery self discharges) as well as for just after manufacture, where the device could be sat on a shelf for a long time.
Older devices didn’t have self discharge (other than inherent/natural self discharge) and while it means the battery retains charge for far longer, the overall lifespan of the battery is reduced.