Coding - the most basic action needed to write a software, which basically is just typing symbols in the editor without a purpose and much thinking
Hacking - process of thinking with purpose to find a weak part of the system. When the weak parts found, a person might break the system, steal some information, affect the availability or integrity of the system. Many security engineers and testers also have to hack their own systems with the purpose to prevent evil hacking.
Hacking is also an international criminal offense (cybercrime).