This paper presents a simulation study on the influence of rock heterogeneity on the distribution and magnitude of trapped CO2 resulting from a drainage/imbibition sequence in a saline aquifer with buoyant CO2. Four scenarios are studied, three simple 1D cases and a 2D case with heterogeneity derived from realistic architecture inspired by tidal sand deposits, having combined layering and crossbedding and sediment property contrasts. The four cases are examined in order to understand which underlying mechanisms are responsible for the results observed and therefore also which processes it is necessary to reflect in the simulation procedure. It is shown that it is important to take into account hysteresis in the capillary pressure. During the imbibition the capillary pressure decreases and the ability to capillary trap the CO2 is reduced and it may in some cases completely vanish. Thus, the capillary pressure hysteresis has a major impact on the amount of trapped CO2. If the imbibition curve has a threshold pressure the sealing power of the barrier is not completely lost, which leads to hyper-trapping, characterised by mobile CO2 being trapped with above end-point saturations. If the imbibition capillary pressure reaches zero, only local barriers constituting effective seals are able to trap free and potentially mobile CO2 and the trapping mechanism is exactly the same as the one acting beneath the top seal. The neglection of capillary pressure hysteresis may result in a large overestimation of the amount of trapped CO2.