1. An initial estimate is made that is fairly accurate.
2. Someone in management says "that's too long, we've got to find a way to bring in that date"
3. The estimate is revised to assume the best case possible execution time in each task, that resources will be available as soon as they are needed, that everything is fully parallelizable.
4. The estimate now magically matches the target date.
5. Actual execution time is close to the original estimate.
People make bad estimates because (other) people don't want good estimates.