A void cancels a card authorization before it has been captured, so the funds never leave the cardholder's account and no money moves in either direction. Nothing is returned, because nothing was ever taken: a voided transaction disappears instead of showing up as a charge followed by a credit.
Void definition and the window that closes with the batch
The working void definition is narrow. An approved card payment leaves the merchant holding an authorization, a reservation against the cardholder's available balance that has not yet been claimed. That reservation can be cancelled at any point until it is submitted for capture, and captures are normally sent to the acquirer in an end-of-day batch. In practice the window is the trading day.
Once the batch has gone out, the instruction is no longer available. Knowing what is void and what is already captured therefore decides which message goes out: undoing the sale after the batch means a refund, which moves settled money back along the rails and takes days rather than seconds.
What the cardholder sees while the hold clears
The pending line drops off the account, though not always immediately. Releasing a hold is the issuer's job, and some issuers take several days to act on the message. A customer whose first attempt failed, was retried, and was then voided can see two pending amounts at once and conclude they were charged twice. Support scripts that explain the hold rather than denying it remove a large share of those tickets.
Voiding part of a sale
Partial voids are rarely supported. Where only part of an order needs cancelling before capture, the options are to capture a lower amount, which many acquirers allow, or to void the whole authorization and re-authorize the correct figure, accepting that the second request may be declined. After settlement, only a partial refund achieves the same result.
Void meaning outside payments
In contracts and law, the void meaning is stricter: without legal effect from the outset. A void agreement was never enforceable, as opposed to a voidable one that stands until a party cancels it. Both senses share the same idea, an event treated as though it never happened, which is why payments borrowed the word.