Not much detail. What is the exact model of the laptop? You can get this information by clicking the Apple menu and selecting "About This Mac".
What is the condition of the battery? Option-click the battery icon or check the "Power" section of the Apple System Profiler. If the battery condition shows anything other than "Normal", or if the Battery Charge Cycles is near or especially if exceeding 1,000 cycles, then the battery is definitely worn out or failing.
Run the Apple Diagnostics to see if any hardware issues are detected.
Are you sure the battery was actually at 100%? With Optimized Charging enabled, sometimes macOS will pause charging at 80%.
If this is an Intel Mac, then an SMC Reset option may be an option as well.
Edit: You may also have an issue with some third party software. Run the third party app EtreCheck and post the complete report here so we can examine it for possible clues.
How to use the Add Text Feature When Posting an EtreCheck Report - Apple Community