We use the word "ĝi" when we are not talking about a man or a woman, but about something that has no sex or whose sex is unknown or indifferent to us. Consequently, we can almost always use this word very well in place of "tio", whose meaning is almost the same.