How does off-chain transaction take place on blockchain?

Off chain transactions take place outside of the blockchain. These can be executed by the use of a third party to confirm the transaction – such as payment processors or exchanges, by a transfer agreement or by exchanging private keys. This happens out of the blockchain but may be eventually recorded on the blockchain.

There are arguments made against both and have their advantages depending on the goal. If the objective of the transactions are security, immutability and validity, then on chain is best. On the other hand, off chain is better where speed and transaction costs are critical.