Hi Jon,
"im" answers the question "Where is it?" It tells you that the object is in a certain place. This is the Dativ case.
"in den" indicates that you're putting the object in a different place (in your example: from outside the fridge into the fridge). This is the Akkusativ case.
Another example is:
Ich bin im Park = I am in the park
Ich gehe in den Park = I am going to the park