The verb 'to have' is conjugated like this (in the present tense):
I have you have s/he, it HAS we have they have
1. I like it. "Do you like fish soup?" "Yes, I like it."
2. I like that. "I'm making fish soup for dinner." "Great! I like that."
The two words are similar. They are (in your examples) both pronouns used to refer to something already mentioned and understood. 'It' stands for an inanimate object (or, sometimes, an animal), and, while 'that' can do the same job, it is also used to differentiate between two objects:
"Do you want this?" "No, I want that."