If you have Optimized Battery Charging turned on, charging will stop at 80% or so when hooked up to the Studio Display.
Use the battery status menu to resume charging if you need to have your Mac fully charged sooner.
support.apple.com
Sometimes it takes a bit for the MacBook to learn your charging routine. In my case, it took a few weeks.