When the pronoun it is used like that, it is known under the names of impersonal pronoun, impersonal subject or simply dummy pronoun (all these terms mean the same thing). The idea with impersonal pronouns is that they don't really refer to anything (neither animated nor inanimate objects). They're just there to make the sentence syntactically complete. As you may already know, a complete sentence in English should contain a subject (that which we are talking about) and a predicate (what the subject is doing or what is being done to it). For example:
He is a very tall guy.
He there is the subject of the sentence and is a very tall guy its predicate. Omitting any of these two pieces makes the sentence incomplete which means that we would really have no idea what or who the sentence is talking about. I think that's pretty clear.
However, there are situations where the subject is either implied or simply does not exist. For instance:
It's good to be home.
What or who is home? Well, nothing is home. We're not talking about someone or something being home. This is just a general statement expressing the idea that it feels good when you've finally come back home. it is not referring to anybody. Although some might argue that it in this sentence actually refers to the situation itself (one certainly can think of it like that), it really doesn't. It has to be there to fulfill the role of the subject which otherwise would be missing. Sure, colloquially, we could throw away it's and simply say good to be home, but grammatically we would still understand that it's there. This is just how English grammar works.
Of course, this has not been a thorough explanation of this topic, but is certainly close enough for government work.