The Baiyun sag of the Pearl River Mouth Basin has become a focus for deepwater exploration with the highest hydrocarbon potential in northern South China Sea. The Eocene organic-rich mudstones are the main source rocks in the Baiyun sag, and the evolution of their depositional environment remains unclear. Based on the core and geochemical data, we investigated the depositional environments of the Eocene Wenchang and Enping sediments in the Baiyuan sag and revealed the sedimentary environment influences on the formation of the source rocks in the study area. The results indicate that the sediments of the Wenchang and Enping formations were deposited in dysoxic to oxic environments. Moreover, according to the concentrations of salinity-sensitive trace elements, and δ13C (-10.9‰ to -7.2‰, average -8.58‰) and δ18O (-18.4‰ to -14.5‰, average -17.1‰) values of carbonate cement in the sandstone samples, the Wenchang and Enping formations were in fresh water to brackish water conditions during their deposition, with increasing salinity from bottom to top, which suggests that the two formations were mainly deposited in lacustrine environment and the Enping formation experienced a relatively extensive lake transgression. The vertical variations of geochemical characteristics suggest that the Wenchang and Enping formations were deposited under a semi-arid/warm condition and all Eocene sediments experienced mild to moderate chemical weathering, relatively large detrital input and stable paleowater depth. Both primary productivity and preservation conditions played essential roles in controlling the enrichment of organic matters in the Baiyun sag, and the preservation conditions resulted from the restricted water setting. The present work provide a comprehensive analysis of depositional environments based on the abundance of high-resolution geochemical data. The results obtained reveal the dominated factors controlling organic matter enrichment in the Baiyun Sag of the Pearl River Mouth Basin. Those findings are not only significant for understanding the region’s paleogeography, but also provide guidance for future profitable oil and gas exploration in the northern South China Sea and other similar areas.