Why do recipes state to “let cool before chilling”?

For example: I’m making brownies and I want that fudgy chewier texture. I’ve heard people say that I need to let it cool completely before putting in the fridge or freezer. Others say to let cool slightly and put in the freezer after little time.

Why is letting baked goods come to room temperature so imperative?