Despreading: correlation is the whole trick.
The receiver multiplies the incoming signal by the same pseudo-random code, aligned in time, and integrates — it correlates. For the wanted signal the code cancels itself and the data collapses back to narrowband, concentrating all its energy. For anything uncorrelated with the code — noise, other users, a narrowband interferer — the multiplication spreads it out instead, so only a small fraction lands in the data bandwidth.
That asymmetry is the processing gain: the wanted signal is gathered up while interference is dispersed, improving the effective signal-to-interference ratio by the spreading factor. A narrowband jammer that would swamp the raw data becomes a faint, spread-out background after despreading.