This paper focuses on county-level grain production and food security in North China; selects 17 indicators from both climatic conditions and human activities; applies yield fluctuation coefficients, spatial econometric modelling, the random forest method, and factor analysis to study the characteristics of grain production in North China and the influencing factors; and evaluates the situation of food security in North China based on grain production capacity. The following results were obtained: (1) The spatial and temporal changes in grain production located in North China from 2000 to 2020 are obvious. The grain output in North China from 2000 to 2020 maintains fluctuating growth at a rate of 0.38 × 1011 kg/10a. The east and south are the key areas for grain production in North China. Grain output was relatively stable except for 2003. with the cold spots of grain production being mainly in the northwestern area and the hot spots in the central and southern areas. (2) The changes in grain production in North China from 2000 to 2020 were less affected by climate and mainly influenced by human activity indicators. (3) As time progresses, the area of food shortage zones decreases in size, becoming evenly distributed and dispersed from the initial concentration in northern Hebei and most of Shanxi; the change in the supply-demand equilibrium zones is not obvious; and the area of surplus grain zones increases markedly in size, with a tendency to expand from the south and centre of the study area to the west and north. The grain production capacity of counties in the northwest and north is generally low, and even counties located in surplus grain areas have potential food security risks. However, in the east and south, due to their high grain production capacity, the per capita grain supply situation may be alleviated even in counties located in grain shortage areas. This study can deepen the understanding of the characteristics of food production in North China and enrich the research on food security. Analyses of factors influencing food production will improve a deeper understanding of food security. Food security evaluation based on food production capacity will contribute to a more precise and comprehensive understanding of the food security pattern in North China.