When your iPhone isn't in use, it still drains battery as there are plenty of background tasks always running, such as notifications, widgets, background app refresh, and more.
Also, you should be charging your iPhone all night, every night as a habit. If you don't charge your iPhone overnight, that explains the battery drain into the next day. Allowing your iPhone to charge overnight with Optimized Battery Charging, which is safe for the battery, allows you to wake up with a fully charged iPhone. In addition, your iPhone's background tasks and indexing happen mostly on charger, so if you aren't giving your iPhone that adequate time, it has to find other time to do it, which can be inconveniently when you are using your iPhone and cause it to drain more battery.
About Charge Limit and Optimized Battery Charging on iPhone - Apple Support