There is a strong adsorption reaction between a surface and whatever compound in a solution is has the strongest affinity (call it compound A). This affinity can be van der Waals forces, hydrogen bonding, ionic, or in some specific cases covalent bonding. This is driven by the fact that a solid surface does not want to be in direct contact with the environment. I'm guessing here, but having gas molecules adhered to a surface is probably a high energy state, whereas having a semi-organized monolayer of liquid or solid is lower.
Once this monolayer is established you need to disrupt it to replace it with something else (compound B), unless it is quite volatile. Sometimes you can overcome it with sheer concentration gradient if the difference in affinity for the surface between compound A and B isn't too large (say, replacing one alkane with another alkane).
Just because that surface molecule is soluble in a rinsing solvent doesn't mean the monolayer will be removed, often it has a much higher affinity for the surface than it does to be dissolved in a solute.
Here is how sensitive this can be, machines like XPS are incredibly sensitive to contamination, and if they are contaminated with outside gaseous hydrocarbons from local air those molecules will stick to the walls, and slowly outgas tiny amounts which foul up measurements. The whole machine has to be baked out at several hundred °C to force it all to stop adhering to all the metal surfaces, go into the gas phase, and get sucked out by a vacuum. Keep in mind, this is compounds like methane that got in there by being gas at room temperature!
Ligand exchange in metallic nanoparticles is also great example of this phenomenon.