The heterogeneous pore structure and the confinement effect of the narrow pore space lead to the differential release/retention phenomenon of hydrocarbons in unconventional reservoirs. So far, the mechanism of this phenomenon, in particular the dynamic process, requires further investigation since it affects the design of gas-based enhanced oil recovery (EOR) operations. In this work, we aim to numerically study the capillary condensate trapping mechanism that causes the differential release phenomenon by conducting molecular dynamics (MD) simulations.In our work, a two-bath MD model is set up, in which two baths are used to mimic the bulk pores and a nano-channel connecting the two baths is used to model the pore throat. Methane (C1) and decane (C10) molecules are used to represent the light and heavy component of the in-situ oil. The MD results show that at the early stage of the primary depletion, the light components release faster than the heavier components, leading to increasing gas oil ratio (GOR) above the system’s bubble point. As depletion continues, heavier hydrocarbons accumulate in the nano-channel due to the confinement effect, while light hydrocarbons tend to remain in the dead-end pores. During the gas EOR process, the injected gas ‘dissolves’ the liquid in the nano-channel and thus enhances the recovery of the ‘trapped’ hydrocarbons.This work systematically investigates the impact of pore throat on the differential release and trapping effect. We demonstrate that a significant amount of light hydrocarbons may be ‘trapped’ during the primary depletion of unconventional reservoirs, due to the capillary condensate trapping effect. The trapped hydrocarbons can be partly recovered through gas injection. Our study has implications for practical EOR operations.