Grain-Scale Mechanisms Of Particle Retention In Saturated And Unsaturated Granular Materials