Sustainability challenges related to food production arise from multiple nature-society interactions occurring over long time periods. Traditional methods of quantitative analysis do not represent long-term changes in the networks of system components, including institutions and knowledge that affect system behavior. Here, we develop an approach to study system structure and evolution by combining a qualitative framework that represents sustainability-relevant human, technological, and environmental components, and their interactions, mediated by knowledge and institutions, with network modeling that enables quantitative metrics. We use this approach to examine the water and food system in the Punjab province of the Indus River Basin in Pakistan, exploring how food production has been sustained, despite high population growth, periodic floods, and frequent political and economic disruptions. Using network models of five periods spanning 75 y (1947 to 2022), we examine how quantitative metrics of network structure relate to observed sustainability-relevant outcomes and how potential interventions in the system affect these quantitative metrics. We find that the persistent centrality of some and evolving centrality of other key nodes, coupled with the increasing number and length of pathways connecting them, are associated with sustaining food production in the system over time. Our assessment of potential interventions shows that regulating groundwater pumping and phasing out fossil fuels alters network pathways, and helps identify potential vulnerabilities for future food production.