When you melt sugar in a pan, it undergoes caramelization, resulting in a brown, sticky residue that can be difficult to remove if not cleaned promptly.