Why is a cool basement damp, in terms of humidity?

I know that when you increase temperature and relative humidity decreases but I don't get how this fits?
It's a closed environment so maybe there is condensation?

Yes, hot air holds more water.

Fog happens if air saturated with all the moisture it can hold cools down. Similarly if saturated air comes in contact with a cool surface like a basement wall that air cools and the water condenses out.

Interestingly by the way, hot water holds less air :) Cold water deep in the ocean tends to have a lot of dissolved air (and of course oxygen) in it. If that cold oxygen rich water rises into a shallow area, for example a fishing bank, it rises full of oxygen and grows lots of plants and fish, which is why it is called a fishing bank ;)