In this snippet from Jackie French's Beyond the Boundaries, the last two sentences begin with 'it'—but one is empty, and one is not. Can you tell the difference?
'Aaah!' Martin muffled a scream. But the water wasn't boiling. It was as hot as a shower at home. It had just been the shock.
With the context of the previous sentence, we can see that the first 'it' is actually a pronoun referring to the water. "The water was as hot as a shower at home."
So we can see that not every 'it-was'-type phrase will have empty subjects.
But what is the second 'it' referring to?
Does it mean "The scream had just been the shock"? Not exactly. "The water had just been the shock"? Doesn't really make sense either.
The empty 'it' really means 'the reason': "the reason he screamed wasn't the heat, it was the shock of the water".
But notice how spelling it all out starts to sound clunky and obvious? That's part of the reason why empty subjects exist: so that we can use context to communicate more smoothly and quickly.
What about 'there'?
Just as 'it' can stand in for a 'thing', 'there' can stand in for a 'place'.
For example:
We went to the museum.
Becomes:
We went there.
However, 'places', which are usually created using prepositional phrases like in the example above, can't usually fill the grammatical subject position. So if a sentence starts with 'there was...' it's almost certainly empty.
Let's look at an example. We can say:
The museum is crumbling.
We could replace "the museum" with the pronoun, 'it' and get:
It is crumbling.
Which means that "the museum" is a 'thing'. And when we say:
There is crumbling.
'There' is empty, and we mean something less concrete, like "crumbling is happening" (but we don't know what is crumbling, or where).