He likes going to the library to study. That always makes her happy.
What if the last sentence were to be changed to
It always makes her happy.
Do these two sentences mean something different? It seems to me that "that" is referring to his attitude, and "it" refers to the act of studying.
What about this:
Her boyfriend likes playing with her dogs. That always makes her happy.
and
It always makes her happy.
Would "that" be reffering to her boyfriend's attitude towards her dogs, while "it" refers to the actual act of playing with them?