It: while we wanna refer to a thing,animal,idea, .... that has already been mentioned we use"it"
That: like "it" but while we wanna refer to a thing or idea or animal that isn't available we use "that"