We use TheThreeHundred project, a suite of 324 resimulated massive galaxy clusters embedded in a broad range of environments, to investigate (i) how the gas content of the surrounding haloes correlates with the phase-space position at z = 0 and (ii) the role that ram pressure plays in this correlation. By stacking all 324 normalized phase-space planes containing 169 287 haloes and subhaloes, we show that the halo gas content is tightly correlated with the phase-space position. At ∼ 1.5- 2, R200 of the cluster dark matter halo, we find an extremely steep decline in the halo gas content of infalling haloes and subhaloes irrespective of cluster mass, possibly indicating the presence of an accretion shock. We also find that subhaloes are particularly gas-poor, even in the cluster outskirts, which could indicate active regions of ongoing pre-processing. By modelling the instantaneous ram pressure experienced by each halo and subhalo at z = 0, we show that the ram pressure intensity is also well correlated with the phase-space position, which is again irrespective of cluster mass. In fact, we show that regions in the phase-space plane with high differential velocity between a halo or subhalo and its local gas environment are almost mutually exclusive with high halo gas content regions. This suggests a causal link between the gas content of objects and the instantaneous ram pressure they experience, where the dominant factor is the differential velocity.