For openers, read "Software Engineering Economics", by Barry Boehm, and "Controlling Software Projects", by Tom DeMarco. After you have read and digested those two, read "Software Cost Estimation With COCOMO 2", by Barry Boehm.
For what I have to say next, it will help you a LOT to have taken a probability and statistics class, even a basic cookbook one.
No estimate is perfect. There is some probability of coming in early, and some probability of coming in late. Boehm's original detailed COCOMO model gave predictions that turned out to be within 30% of the actual result, better than 60% of the time. That was a lot better than what was common when he wrote and published the book.
When you take your best guess (and that's all an estimate is), you are including those probabilities. If you pull the estimate in, you are increasing the probability that you will come in late. If you increase the estimate, you are increasing the probability that you will come in early or finish on time. How much you pull it in or let it out controls how the probability changes, and must necessarily depend on the penalties for being early or late. (Insert horror stories here - and there've been a LOT of them over the years!)
DeMarco addresses this to some extent. He also points out that there is an "impossibility region": some schedules are just too tight to be made, no matter what kind of heroics are attempted.