Food insecurity and child mental health difficulties frequently intersect, yet the mechanisms and pathways connecting them remain underexplored in resource-limited settings. This study developed a contextually grounded explanatory model to examine these relationships within a single rural Ugandan setting. We conducted 12 focus group discussions with 36 teachers across four schools in Masaka district, drawing on their sustained observations of children’s food insecurity and mental health difficulties across a nine-month timeframe. Data were analysed using realist thematic analysis, supported by iterative coding, nine consensus meetings and member checking. Three interrelated pathways were identified. In the social causation pathway, food insecurity, manifested through hunger-related stress, food-related stigma and irregular or inadequate meals, preceded and contributed to mental health difficulties. In the social drift pathway, preexisting mental health difficulties among caregivers and/or children disrupted household functioning and food provision, increasing vulnerability to food insecurity. A bidirectional pathway captured recursive processes in which food insecurity and mental health difficulties co-evolved and reinforced one another over time. These pathways shaped children’s mental health and educational engagement within school environments. The findings offer context-specific insights that may inform research in similar settings. They also highlight the potential value of integrated, multi-level interventions, while underscoring the need for longitudinal and intervention research.