A stock option is an agreement for you to be able to buy 1 or more shares of stock at a set price over some duration of time.
If you exercise a vested stock option, you are then purchasing 1 or more shares of stock (for the purposes of this discussion, almost always "common" stock) in the company.
In the case of an equity event (the company gets sold, liquidated, etc.) the company gets valued at some amount and the investors get paid a portion/percentage of this based on previously agreed-upon, or re-negotiated, contracts.
Investors typically have "preferred" shares, and in most scenarios the preferred shares get paid first, and remaining funds (if any) get distributed equally among the common shares.
If the equity event is not highly positive, eg: the company has sold at a loss or a very small multiple (~3-5x total investment amount) then the common shares almost always end up valueless.
IANAL, and this is not legal advice, but I have hardly ever seen or heard of any scenario in a startup where it seems logical to exercise (purchase) common shares BEFORE you know the exact value of those shares. Exercising pre-IPO shares before the outcome of the company is VERY highly predictable is a very risky investment scenario.
EDIT- I think I misread your question initially. If you have options that are in the money, then you would pay the company, or an appointed captive broker, to exercise (purchase) the shares. At that point you own shares of stock. From there you can either hold those shares (long-term hold, over 1 year, can affect gains taxes in a positive way), or you can sell those shares. If you exercise the options and immediately sell them, then the broker or company just issues you a check for the delta.
The money paid for the exercise price ultimately goes to the company, the same as for any other stock sale/purchase. Most companies don't use money from stock sales to issue new shares, they use those funds for operations of the company (R&D, etc.). When the stock was placed on the market the company set a value for itself (say $100,000,000), and issued a number of shares of stock, a share being a fractional ownership percentage in the company. So, if they issue 1,000,000 shares, each share is deemed to be worth $100. If they issue 100,000,000 shares, each share is worth $1. Without going too deep into the details, the company can issue almost any number of shares, this is why "stock price" and "option strike price", or "number of options" is a worthless data point without understanding how many shares of stock are issued by the company and what the corporate valuation is. I could have a company worth $10 ($10, not $10,000,000), and issue a billion shares of stock. Then I could try to recruit people by offering them each 1,000,000 shares, but that 1,000,000 is such a small fraction of a billion they they have no effective value, especially in a company only worth $10.
Sorry for the ramble, hopefully some of this was helpful.