The process of primary migration, which controls the transfer of hydrocarbons from source to reservoir rocks, necessitates the existence of fluid pathways in formations with inherently low permeability. Primary migration starts with the maturation of organic matter that produces fluids which increase the effective stress locally. The interactions between local fluid production, microfracturing, stress conditions, and transport remain difficult to apprehend in shale source rocks. Here, we analyze these interactions using a coupled hydro-mechanical model based on the discrete element method. The model is used to simulate the effects of fluid production emanating from kerogen patches contained within a shale rock alternating kerogen-poor and kerogen-rich layers. We identify two microfracturing mechanisms that control fluid migration: i) propagation of hydraulically driven fractures induced by kerogen maturation in kerogen-rich layers, and ii) compression induced fracturing in kerogen-poor layers caused by fluid overpressurization of the surrounding kerogen-rich layers. The relative importance of these two mechanisms is discussed considering different elastic properties contrasts between the rock layers, as well as various stress conditions encountered in sedimentary basins, from normal to reverse faulting regimes. Results show that the layering causes local stress redistribution that controls the prevalence of each mechanism over the other. When the vertical stress is higher than the horizontal stress in kerogen-rich layers, microfractures propagate from kerogen patches and rotate toward a direction perpendicular to the layers. Microfracturing in kerogen-poor layers is more pronounced when the confinement in these layers is higher. Those mechanisms were shown to be representative of Draupne formation.