This can be a big problem if you exercise stock options, then the price of the stock drops. You might not be able to sell the stock for enough to pay the taxes you owe, and although you can take a capital loss, you can't use capital losses to offset normal income (beyond a fairly small limit each year).
[1] https://www.nceo.org/articles/stock-options-alternative-mini...
Source: I had a fat AMT tax bill precisely because of this. :/
I'm certainly not an expert, so don't listen to me for any financial or legal advice.
Like most Bay Area tech workers, I'm compensated partially in stock. Every month, X shares of my restricted stock "vest", which means, in practical terms, that I receive those shares. That counts as taxable income at the current market value of those shares. To avoid making me pay a large tax bill come April, my employer actually withholds some of those shares of stock to cover the tax bill.
(I've never been entirely sure how this stock-withholding works from a tax perspective. Do they immediately sell those shares and pay the proceeds to the government along with the rest of my income tax withholding?)
I think that your employer actually sells just enough of those shares at the time of vesting to cover the taxes. Any cash remaining difference is given to you in your next paycheck (i.e. 2 shares at $100 ea. are sold to cover $120 of taxes, and $80 is given to you). Could be wrong though.