Relative permeabilities show significant dependence on the saturation path during CO2 enhanced oil recovery (EOR) and storage. This dependence (or hysteresis) is particularly important for water-alternating-gas (WAG) injection, a successful CO2 EOR and storage method for clastic and carbonate reservoirs. WAG injection is characterized by an alternating sequence of drainage and imbibition cycles. Hysteresis is hence common and results in residual trapping of the CO2 phase, which impacts the volume of CO2 stored and the incremental oil recovery. The competition between hysteresis and geological heterogeneity during CO2 EOR and storage, particularly in carbonate reservoirs, is not yet fully understood.In this study, we use a high-resolution simulation model of a Jurassic Carbonate ramp, which is an analogue for the highly prolific reservoirs of the Arab D formation in Qatar, to investigate the impact of hysteresis during CO2 EOR and storage in heterogeneous carbonate formations. We then compare the impact of residual trapping (due to hysteresis) on recovery to the impact of heterogeneity in wettability and reservoir structure. End-member wettability scenarios and multiple wettability distribution approaches are tested, while, effective fracture permeabilities are computed using discrete fracture networks (DFN), ranging from sparsely distributed background fractures to fracture networks where intensity varies with proximity to faults.The results enable us to analyze the efficiency of oil recovery and CO2 sequestration in carbonate reservoirs by comparing the impact of physical displacement processes (e.g., imbibition, drainage, residual trapping) and heterogeneous rock properties (e.g., wettability, faults, fractures, layering) that are typical in carbonate reservoirs. We show that although the fracture network properties have the greatest impact on the fluid flow, the effect of wettability and hysteresis is nontrivial. Our results emphasize the need for wettability to be accurately measured and appropriately distributed in a reservoir simulation model. Similarly, our results indicate that hysteresis effects in cyclic displacement processes must be accounted for in detail to ensure that simulation models give accurate predictions.