hmmmm, just out of curiosity, what makes some dairy (like butter) ok to leave out for a couple days, but not others?

When I cover a cake with cream cheese icing, I don't refrigerate it...isn't it the same? I honestly don't know!

I'd love some insight on this from those of you who know the "science" part of baking!!
