Most option traders don't want to actually buy or sell the underlying stock. They just use options as a trading vehicle perhaps making money on the time decay, on changes to volatility, etc. My question is, if most traders are motivated to sell or buy to close their option contracts before the expiration date, who's actually holding the contracts at the end of their life? Do brokerages or exchanges sort of let those pile up and balance each other out or what?
Options that are not worth exercising just expire. Options that are worth exercising are typically exercised automatically as they expire, resulting in a transfer of stock between the entity that issued the option and the entity that holds it. OCC options automatically exercise when they expire if the value of the option exceeds the transaction cost for the stock transfer (1/4 point to 3/4 point depending).
Firstly "Most option traders don't want to actually buy or sell the underlying stock."
THIS IS COMPLETELY UTTERLY FALSE
Perhaps the problem is that you are only familiar with the BUY side of options trading.
On the sell side of options trading, an options desk engages in DELTA HEDGING. When we sell an option to a client. We will also buy an appropriate amount of underlying to match the delta position of the option.
During the life time of the option. We will readjust our hedge position whenever the delta changes (those who follow Black Scholes will know that normally that comes from (underlying) price changes).
However, we lose money on each underlying change (we have to cross the bid-ask spread for each trade). That is why we lose money when there is volatility. That is why we are said to be "short VEGA" or "short volatility".
So one way to think about "buying" options, is that you are paying someone to execute a specific trading strategy.
In general, those who sell options, are also happy to buy options back (at a discount of course, so we make a profit). But when doing so, we need to unroll our hedging position, and that again incurs a cost (to us, the bank).
Finally. Since this is "money" stackexchange rather than finance. You are most likely referring to "warrants" rather than "options", which are listed on stock exchanges. The exchange in most regions give us very specific and restrictive regulations that we must abide by. One very common one is that we MUST always list a price which we are willing to buy the warrants back at (which may not be an unreasonable spread from the sell price).
Since an Option is a synthetically created investment instrument, when we buy back the Option from the investor, we simply unwind the underlying hedging positions that we booked to synthesize the Options with.
Source: I've worked 2 years on a warrant desk, as a desk developer.
To answer your follow up questions, the fundamentals of option trading means that there will always be a balance in options. Every time one party sells a contract, there is a buying party on the other end. A party might be trading to open, or trading to close the position.
When both parties are trading to open, an option is added to the 'open interest' pool. When both parties trade to close, it removes one from the pool. When one opens and the other closes, the open interest number remains the same, but the option was essentially transferred from the closing party to the opening one. Thus every option represents a match of two parties with open positions in the underlying contract.
After reaching their expiration date, all options are either executed or expire worthless. As each option represents a match between two parties, each contract has someone to execute on.
Complications only arise if one of the parties is unable to fulfil the option contract, for which there are margin limit requirements and margin call actions that the broker might resort to in order to not be on the hook for the executing contract.
I interpret the question as asking why there is a liquid market in options, so that any one trader can buy or sell when desired. This is similar to the reasons for liquid markets in other instruments: a combination of arbitrage and elastic supply/demand. (These are the fundamental reasons, but in addition market makers are tasked with helping maintain liquidity through short-term disruptions.)
If you are offering a particular option at a low enough price, or bidding for it at a high enough price (relative to other options and the underlying), then even if no one would otherwise be interested in taking the other side of that order, self-interested traders will step in when a risk-free arbitrage is possible. So you can usually close your position for something close to fair value.
If your demand isn't subject to direct arbitrage (e.g., if you're making a straddle bet on volatility with both puts and calls), you can still get your trade done with someone who thinks volatility will be higher or lower than your offer or bid implies. This is much like the trading of ordinary stocks, where a seller can pretty much always find buyers by offering at a low price, or vice versa by bidding at a high price. As the price falls, previously reluctant buyers come out of the woodwork (elastic demand), and vice versa. It's a big market, and you just have to adjust the price enough to shift the global balance of supply and demand by your few contracts.
That said, options are typically less liquid than their underlying stocks, and options with very low fair value may have no bids.