Well, a watermelon has a much higher specific heat than a sandwich. This is because Water (H2O) has an unusually high specific heat, and the watermelon contains much more water than the sandwich. The higher the specific heat of an object the more calories it takes to increase its temperature, this applies to cooling as well. So, a watermelon will take longer to get cold, but it will stay cool longer.

Another factor is the surface area in comparison to each objects mass. The Watermelon, in a sense, insulates the temperature of the cooler.