In traditional cryptocurrencies a trusted third party such as an cryptocurrency exchange or decentralized exchange (DEX) is necessary to perform a swap of cryptocurrencies in order to prevent one party from sending a currency without receiving a currency in return. An atomic swap is an all-or-nothing way to trade cryptocurrencies without those risks. An atomic swap system can use a hash time-locked smart contract so that a party must deliver the currency to be swapped within a specified time, or else the transaction will be cancelled. This preserves atomicity in that either the swap will take place, or no currency will be swapped. 
Atomic swap process
Atomic swap or atomic cross-chain trading (ACCT) is a mechanism, where two (or more) parties own coins in separate cryptocurrencies, and want to exchange them without having to trust a third party. The term “atomic” here means indivisible, and refers to the fact that sending cryptocurrency on one chain and sending other cryptocurrency on the other chain cannot be performed independent of each other. If these transactions could be performed independent of each other, then while one party could fulfill their side of the bargain and send some cryptocurrency on one chain, the other party would have the option of going back on their end of the bargain and simply not following through with the protocol, ending up with both cryptocurrencies.
A decentral exchange where two parties, A and B, want to exchange cryptocurrencies can be based on the following process:
A generates some random data (called the secret) x.
A generates T x1 (the payment) containing an output with the chain-trade smart contract in it. It allows coin release either by signing with the two keys (Ak and Bk) or with (secret x, Bk). This transaction is not broadcast. The chain release script contains hashes, not the actual secrets themselves.
A generates T x2 (the contract), which spends T x1 and has an output going back to Ak. It has a lock time in the future and the input has a sequence number of zero, so it can be replaced. A signs T x2 and sends it to B, who also signs it and sends it back.
A broadcasts T x1 and T x2. B can now see the coins but cannot spend them because it does not have an output going to them, and the tx is not finalized anyway.
B performs the same scheme in reverse on the alternative chain. The lock time for B should be much larger than the lock time for A. Both sides of the trade are now pending but incomplete.
Since A knows the secret, A can claim his coins immediately. However, A, in the process of claiming his coin,reveals the secret x to B, who then uses it to finish the other side of the trade with (x, Bk).
Atomic swaps have the disadvantage that both chains need to implement the atomic swap (of course in addition to being capable to provide smart contracts) in order for this to work.
The idea of atomic swaps was first described in 2013 by Bitcointalk user Tier Nolan.
ZCash releases their tool atomic swap tool, ZBXCAT, in experimental stage Oct 2017.