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