After you gain experience from previous slipped deadlines, you can see patterns that lead to slippage and, more importantly, get wise to the smell of unrealistic expectations. That's how you know that deadlines are going to slip.
you're assuming that deadlines are set based on the amount of time the work requires. Not often true. Generally deadlines are set before anyone knows how much work is required.
Those multiply by whatever factor estimates are perhaps defensible if you're talking about a few person-hours for a small no-bid project.
It falls apart if you're talking about 10's to 100's of people working for weeks/months/years, or wherever you need to compete with other vendors for the contract.
For those projects, everybody is over-optimistic in their respective bids (some could say they are basically lying...). But that's part of the game unfortunately.
However sometimes, it can be a calculated risk, for most projects, something is provided by the client, and generally they are also late on their parts. If played correctly it can hide delays on your side.
Also, being over-optimistic in a bid doesn't mean you have to be over-optimistic internally, you could set realistic expectations internally and "manage" properly the delays on the customer front.
Just to be clear, this is a cynic view of things. Every time I see something like that, I cringe inside (and even outside).
However the 2x rule can be quite limited in big projects as it doesn't account for the overhead induced by the size. In a team of hundreds, 30, 40 or 50% of the efforts can be lost due to difficulties in communication, management layers, heterogeneous set of competencies and skills, etc. It's harder to identify what this overhead could be. They can be huge differences between relatively well integrated teams and a complete mess.
Hopefully no one is looking at a project and saying "that will take a year". You estimate tasks and that gives you a project timeline. Those tasks get the double and bump.
Or say 2 decades and get all the praise when you come in under time and budget.
How to do you know? Because they almost always slip.
Take the original estimate, which is always optimistic, double it, add another 50% "just in case", and you're a lot closer.