An atomic swap lets users of two separate cryptocurrencies exchange with each other without using an intermediary party, such as an exchange. Atomic swaps take place off-chain via smart contracts. They do this so that the integrity of both chains can remain intact, meaning that each blockchain is sovereign from other blockchains.
For two blockchains to engage in an atomic swap, they have to both use the same hash function.
Atomic swaps reduce the time, cost, and risk of exchanging cryptocurrencies by eliminating third parties, who charge fees and who require trust.