Planning fallacy describes how we generally underestimate the time needed to complete a task

This phenomenon often occurs independently of one's knowledge or past occurrences of similar tasks. Even if you know that the task took longer last time, the planning fallacy still makes you underestimate the time to complete something.

There are multiple reasons, but the main one seems to be a general optimism bias, which leads us to underestimate the time needed and resources for a given task by not thinking of potential problems or other obstacles.

In a 1994 study, students were asked to estimate how long it would take to finish their senior theses. The average estimate was 33.9 days. They also estimated how long it would take "if everything went as well as it possibly could" (averaging 27.4 days) and "if everything went as poorly as it possibly could" (averaging 48.6 days). The average actual completion time was 55.5 days, with about 30% of the students completing their thesis in the amount of time they predicted. (Source)

Counteracting the planning fallacy by using the segmentation effect

You can reduce the effect of the planning fallacy by using the segmentation effect.

The segmentation effect is defined as the time allocated for a task being significantly smaller than the sum of the time allocated to individual smaller sub-tasks of that task. (Source)

So we should break down a single task into small chunks to see all the necessary steps to complete the task, which in turn will negate the planning fallacy—similar to why Writing acceptance criteria helps to know the complexity of seemingly small tasks.