It's not just that, but also we tend to estimate in the context of "if I were sitting at a computer working on just this problem, this is how long it would take." The reality is that there are meetings, high priority bugs for unrelated systems, interruptions from the business, coworkers and life, code reviews for other team members, rediscovering what you were doing before being interrupted, etc.
Using time tracking, I was able to discover I only spend 2-3 hours per workday actually programming, the rest was all interruptions and such. Thus I can estimate that one day really equals 3-4 workdays. Then my project manager throws in another 3-4x on top of that to deal with scope creep, rework, bug fixes, etc... and we're usually on-target ~50% of the time.
When I was at Amazon, I read the SDE guidelines from HR, where they describe their view of the role.
An SDE1 was expect to spend 4hr coding a day; an SDE3 about 2.5hr coding a day.
That’s normal for a job, eg, apartment maintenance (my college job) would have us actually wokring about 4 hours a day, between setup, cleanup, breaks, travel, miscellaneous tasks, etc.
Convincing other SDEs to assign points to stories based on that (4hrs of coding per point) was surprisingly hard.
My friend's advisor in grad school (Physics, not CS) used to ask his students for various project estimates, and then he would double it and increase the units: 2 hours = 4 days; 1 day = 2 weeks; 2 weeks = 4 months; 2 to 3 months = 4 to 6 years = thesis project. My friend's estimated 3 month project turned into his 4 to 5 year thesis project. I mean, hey, it was experimental physics and his project ended up using a shipping container-sized faraday cage, scanning tunnelling microscopes, a clean room wearing a bunny suit, building stuff himself in the machine shop, writing software. All this for something that literally had not been done before and no one was sure it would work or what exactly would need to be done to get there (which starts to sound similar to some aspects of software projects). Plus the usual overhead like teaching ungrateful engineering undergrads (guilty!), hosting movie night at the lab and making liquid nitrogen ice cream, etc.
Using time tracking, I was able to discover I only spend 2-3 hours per workday actually programming, the rest was all interruptions and such. Thus I can estimate that one day really equals 3-4 workdays. Then my project manager throws in another 3-4x on top of that to deal with scope creep, rework, bug fixes, etc... and we're usually on-target ~50% of the time.