No colour is judged in isolation. The visual system reports differences rather than absolutes, so a patch of colour is shifted perceptually away from whatever surrounds it — a grey on a warm ground looks cooler, and the same grey on a cool ground looks warmer. This is simultaneous contrast, and it is a property of vision, not of the paint. Separately and physically, real surfaces bounce coloured light onto each other, so a strong colour genuinely tints its neighbours as well as appearing to.
Saturated colours with a clear hue are the most stable, because there is enough of their own colour present for a contextual shift to be a small proportion of it.
Near-neutrals again: a white beside a warm white looks cold, and the same white beside a blue looks warm. This is why comparing paint samples against the existing wall colour is unreliable — the old colour is actively distorting your reading of the new one. It is also why a colour sampled beside a bright white card can look dingy in a room that contains no bright white.
Testing advice
Leave an unpainted white margin around a sample, and view the sample against the surfaces it will actually sit beside — the flooring, the worktop, the trim. Judging two candidates side by side is reliable; judging one candidate against the old wall colour is not.
Lighting simulations and descriptions here are approximations, not exact physical predictions — see methodology.