Heavy metal(loid)s (HMs) pollution in farmland soil and its induced health risk have attracted great attention worldwide. Hunan Province is recognized as one of the principal rice-producing regions in China. Its farmland is seriously threatened by HM pollution, which poses a great risk to food safety and residents’ health. However, the spatial and vertical distribution, sources of HMs, the main factor affecting HMs accumulation, and related pollution and health risks across Hunan Province’s farmland largely remain unclear. To fill this gap, 62 profile soil samples were collected across the farmland of Hunan Province with depths up to 140 cm, and their Cd, Cr, Hg, Pb, and As content were measured. After that, the source of HMs was appointed using the positive matrix factorization model. Then, the Shapley additive explanations methodology was adopted to quantify the relative contributions of different natural and anthropogenic variables to HM accumulation. Finally, human health risks and potential ecological risks were also assessed. Our results revealed a significant concentration of Cr, Hg, Pb, and As in the farmland of Hunan Province. Only the mean value of Cd (0.42 mg kg-1) in the surface soil surpassed the screening value for assessing the soil contamination risk regulated by the national standard (0.3 mg kg-1, GB 15618-2018), indicating that Cd contaminates the farmland soil in Hunan Province. The HMs were mainly enriched in the surface layer, except for As. The mean contents of Cd, Pb, Hg, and Cr exhibited a decline as soil depth increased. The Pb and Cd in the surface soil of farmland in Hunan Province was largely sourced from industrial and traffic activities, As and Cr are mainly derived from soil parental material, and Hg chiefly stems from atmospheric deposition. The mean annual temperature has the largest effect on Cd, Hg, and Pb accumulation, while Fe2O3 has the largest impact on the accumulation of As and Cr. Children and adults were treated with high carcinogenic risk due to long-term exposure to HMs. Cr was the main contaminant for carcinogenic risks, and dermal contact was the main route for carcinogenic risks. Our results offer empirical evidence to support the prevention and management of HM pollution in the farmland of Hunan Province, as well as to ensure food security.