Gap-graded soils, commonly used in geotechnical and hydraulic engineering applications, exhibit diverse strength characteristics influenced by particle size distribution. To understand the mechanisms governing the strength of gap-graded soils and to develop a predictive formula for strength, this study utilizes the discrete element method to investigate the peak strength of gap-graded soil samples with a wide range of fine particle contents (FC) and particle size ratios (SR). The results reveal a complex and coupled effect of FC and SR on peak strength, with distinct trends in different FC ranges. At the particle scale, the arrangement of particles in initially isotropic gap-graded soils changes under external loading, leading to an increase in branch anisotropy value. The magnitude of this increase is influenced by both the particle size distribution and fine content. A lower value of peak branch anisotropy indicates a more uniform normal force distribution among contact types (coarse-coarse, fine-fine, and fine-coarse force type), resulting in a higher peak strength of the soil. Microscopic analysis confirms a negative correlation between strength and both branch anisotropy and standard deviation of normal contact force proportions at peak state. Furthermore, a peak strength prediction formula incorporating SR and FC is proposed, offering practical guidelines for engineering design involving gap-graded soils.