A three-dimensional invasion percolation simulation model is introduced and integrated into a novel three-dimensional geological modeling framework based on the “unit element” theory to study secondary hydrocarbon migration. Leveraging the computational efficiency inherent in the invasion percolation theory, the simulation method is effectively applied to basin-scale hydrocarbon migration using finely discretized grids. Sensitivity analysis demonstrates the substantial influence of geological parameters including structural configuration, sedimentary facies, and pressure, on simulation results. Noteworthy observations from this study encompass: (1) The intricate influence of sedimentary facies and petrophysical properties characteristics on hydrocarbon migration and accumulation patterns within structural and lithological traps. Favorable petrophysical attributes in the carrier beds enhance the likelihood of accumulation in the structural traps, while lithological traps are prevalent in less conducive carrier beds. (2) The significant impact of sand bodies exhibiting favorable petrophysical attributes, such as channels, on migration and accumulation profiles. This underscores the necessity of incorporating sedimentary facies and rock attributes into oil and gas resource exploration. (3) The pronounced effects of overpressure magnitude and direction on hydrocarbon migration and accumulation dynamics. (4) Optimal strategies for oil and gas resource exploration necessitate a comprehensive assessment of rock attributes, overpressure considerations, and sedimentary facies. The practical implementation of this methodology is demonstrated in an actual exploration project within China's Junggar Basin. The simulation results closely align with established oil recovery data and facilitate predictive identification of promising exploration areas. This indicates the methodology is applicable to all petroleum systems similar to Junggar Basin. Through practical applications, the development of a scientifically rigorous three-dimensional geological model for the study area, coupled with numerical simulations of oil and gas migration, facilitates the elucidation of accumulation patterns. This approach aids in identifying pivotal factors such as sand body distribution, internal structural composition, permeability attributes, and fracture behavior, which collectively influence oil and gas migration. Furthermore, by correlating insights obtained from oil and gas discoveries in wells, a deeper understanding of carrier bed properties and their geological evolution is attained.