Your 2019 MBP is running Intel chips, not at all comparable to the 2020-onwards M processors. I also had a 2019 MBP kitted out as a work computer before and it barely lasted 3h on a normal workday (meetings, compiling code, running Docker, many, many tabs open on browsers, etc.); my work M1 Max lasts anywhere between 8-12h on a heavier workload than what I worked with in 2019 including all I mentioned in the parenthesis.
So yes, software is the culprit but the M-series are much better at managing the same software (and even heavier ones) that I run, for the same job.