I was told if you bake carrots in liquid they won't dry out like they may do without liquid.

How does this work?

Heating food removes water from the food. So does the food absorb some of the water it is sitting in, so that it doesn't dry out?