I put the cake away in the refrigerator. It has a lot of leftovers in it. The It is more likely to refer to The refrigerator than The cake because  it's so big.
In "I put the cake away in the refrigerator. It has a lot of leftovers in it. ", The It is more likely to refer to The refrigerator than The cake because  it's so big.
This example is True.