Chilling the dough before baking it helps to solidify the butter and prevents the cookies from spreading while they bake and maintains their shape.