Sometimes a project might have some hidden problems that are genuinely difficult to solve, just from an algorithmic point-of-view. However, mostly, in my experience, projects fall behind because of factors external to the programming, such as non-robust platforms/frameworks/environments, problems in defining scope, requirements that are not clear and so on.
But the most fantastic answer I've seen to this question is not mine: http://www.quora.com/Engineering-Management/Why-are-software-development-task-estimations-regularly-off-by-a-factor-of-2-3/answer/Michael-Wolfe |