I don't really think that's typically the case. If they think you'll be relatively easily replaced, they'll just let you go when you tell them you have an offer.
The point is they might keep you on for a month or two until they find your replacement (and the other job offer evaporates), then let you go. A lot of companies are shady enough to do this.