Yes, after the due diligence has been carried, the earnest deposit is transferred to either a vendor or their solicitor.
After the deposit has been paid, if any of the parties involved decides not to continue with this purchase two things can happen:
If it's the buyer who doesn't want to carry out the contract he will lose all amounts paid as an earnest deposit. Conversely, if its seller that does not want to continue with sale they will return double what was originally agreed upon as a penitential deposit.