Through a large number of rock thin section microscopic observations, scanning electron microscopy analysis, and fluid inclusion homogenization temperature measurement, the lithological composition of tight reservoirs in the Shanxi Formation of the Yan'an Gas Field in the southeast of the Ordos Basin was studied, lithofacies types were classified, and the diagenetic evolution of different types of rocks was combined with the burial history, thermal history, and hydrocarbon charging process to analyze the time matching relationship between the key oil and gas charging period and reservoir densification. Studies have shown that pure quartz sandstone and quartz-rich low-plasticity lithic sandstone mainly develop mechanical compaction, secondary dissolution, and kaolinite precipitation. Before the two essential hydrocarbons are charged, the porosity is 15.8%–31.5%, which is typical of medium and high permeability reservoir rocks. The porosity of the high tuffaceous heterogeneous quartz sandstone, plastic-rich granular lithic sandstone, and carbonate tight cemented sandstone ranges from 4.6% to 10.8%, indicating that the reservoir is ultra-low porosity-low porosity reservoirs before the first key hydrocarbon charge. It is difficult to charge the hydrocarbons in the later stage. Therefore, the diagenesis of pure quartz sandstone and quartz-rich low-plastic granular lithic sandstone that maintained high porosity and permeability during early oil and gas charging has been inhibited, and the physical properties of the reservoir are relatively good. They are the primary migration channels and accumulation spaces for late-natural gas. This constitutes a sweet spot in tight sandstone gas reservoirs. The research findings are critical for understanding the coupling relationship between reservoir densification and accumulation, clarifying the formation mechanism of effective reservoir rocks, and predicting the distribution of sweet spots.