Ammonium chloride can form in a reaction between carbon dioxide plus two molecules of ammonia plus two molecules of sodium chloride plus water. These reactants combine to form two molecules of ammonium chloride and sodium carbonate. The process is called the Solvay process used to form sodium carbonate.
If two salts are mixed, they can actually be separated once again due to their different physical properties. Ammonium chloride when heated to 640.4 degrees F, will sublimate to form ammonia and hydrogen chloride gases. That is because ammonium salts do not contain an oxidizing agent, and lose ammonia when heated. Because sodium chloride (table salt) will not sublimate and melts at a higher temperature (1,474 degrees F) it will remain behind as a salt. If one collects the gas that is produced, the mixture will be separated--the gas is the ammonium chloride that has decomposed and the sodium chloride will remain in the test tube.