Selling an investment that has fallen creates a realised loss, and most systems allow that loss to be set against realised gains. The result is a reduced liability without a change in exposure. Rules vary by jurisdiction and change over time.
Losses and gains are netted within a period
Tax on capital gains applies to the net figure for the period, not to each profitable disposal separately. Realised losses reduce that total directly.
An investor with a gain on one holding and an equivalent loss on another may therefore owe nothing, having realised both in the same period.
Where losses exceed gains, systems commonly allow the excess to be carried forward and applied against gains in later periods, sometimes indefinitely.
The position can usually be reconstructed
The point of the exercise is to capture the loss without abandoning the investment strategy, which requires replacing the sold holding with something similar.
Broad funds tracking different but related indices are the usual instruments, since they maintain comparable exposure while being distinct assets.
The replacement is not identical, and the difference in behaviour between the two is the cost of the manoeuvre, alongside the trading expenses.
Repurchase rules exist to stop the obvious version
Selling and immediately buying back the same asset would generate a loss with no economic change, so systems disallow it within a defined window.
The window length, and what counts as substantially the same security, are defined in statute and differ meaningfully between jurisdictions.
Breaching the rule typically does not forfeit the loss outright but defers it into the cost of the repurchased holding, which changes the timing rather than the total.
The benefit is deferral rather than elimination
Selling at a loss and repurchasing lowers the cost basis of the position. A future sale therefore produces a larger gain than it would have done.
The tax saved now is largely paid later, so the real benefit is the use of the money in the interim and any difference between current and future rates.
That makes the value of the exercise dependent on the holding period and on rate expectations, neither of which is knowable in advance.
The practice can distort the portfolio
Decisions driven by tax rather than by the merits of a holding can leave a portfolio owning substitutes chosen for their tax status rather than their suitability.
Repeated harvesting also accumulates positions with very low cost bases, concentrating a deferred liability that eventually has to be dealt with.
Because the rules on matching, timing and carry-forward are technical and jurisdiction-specific, this is an area where professional guidance is genuinely necessary.