In very competitive bridge, awareness of when you can double is essential. When it occurs is most often in match points - not IMPs, where the risks and rewards are more similar to Rubber - and in very specific situations. But from my experience, midlevel players don't double nearly as often as they should; perhaps for the best in some cases as they don't have the experience to recognize the situation (and I'd count myself in that group for the most part nowadays), but still - they cost themselves not doubling when they should.
In particular, at the higher levels, you should be able to tell what the rest of the room likely is in. This often occurs when you're facing opponents with unusual conventions, or aggressive opponents. Say, you're in a clearly comfortable spade partscore (2H, expecting to make 8 tricks comfortably, but not comfortable with the game or even the 3 level), after a slowly developing uncontested auction. Your LHO doubles 2H for takeout, and RHO bids 2S. (Yes, this is not that uncommon in aggressive play - the "late" takeout.) This is all vulnerable.
You've clearly got 110 to 140, maybe, and they all of a sudden are declaring, and you're looking at probably setting them 1 - the "cost" in switching from hearts to spades (and switching to defense) is around 2 tricks, in this case. If you pass, they go down one, and get a top board - that's the point of the interference. You have to recognize to double here - because of your situational awareness, that the late takeout double will be fairly rare, and most everyone else will be 2H= or 2H+1, and if you are setting 2S 1, you're bottom board! You could bid 3H of course, but that has its own risks - and if your hand evaluates as perfectly fine on defense, given the point advantage (say you think it's about 22-18), you want to double.
That situational awareness of course also has to recognize when it's a bad idea - when they're not bidding speculatively, but just slowly.
Gavin Wolpert has a good piece on this; in that, he notes first:
When we are entitled to +140 and the opponents compete, scoring +100 just won't cut it. The risk of doubling depends on how many tables have competed to the same level. If we judge that most pairs will sell out and let our counterparts holding our cards make 140, then we must try to protect our equity by getting a bigger plus score.
But then, he shows the opposite:
To demonstrate let's change gears and look at what happens when your opponents bid one more over your 5 level sacrifice. Since most of the field will either play in 4 or double the sacrifice, you will most likely get a near top for +50. If you double them you effectively give up your edge. A plus score of any kind will win the board against all tables which do not find the sacrifice. You will also win the board against all the tables which stop and double the sacrifice. The extra penalty for the double does not help you.
Here the X is tempting, but unnecessary - you already have your advantage over opponents (forcing them to try and make 5); doubling is silly, even if you do think they'll make.
The point is recognizing when it is necessary to protect your part score. When it is - when you have a solid > 100 points in the bag, and they interfere - you basically have a bottom board anyway if they make, or go down one undoubled, so you have to double. It's just a matter of experience recognizing those versus the times when it's just a competitive auction and they happen to get in a bit late.