The Cambridge Dictionary's article "be in for sth" gives two examples:
The weather forecast says we're in for heavy rain this evening.
You'll be in for it (= you'll be in trouble) if you don't do what she tells you.
The first example is clear: the object to "to be in for sth" is "heavy rain".
But the second one appears a bit enigmatic to me.
Does "it" refer to any part of the sentence or context?
Or is "to be in for it" just a fixed expression for "to be/get in trouble"?