Evolutionary biologists have long been interested in parsing out the roles of genetics, plasticity and their interaction on adaptive trait divergence. Since males and females often have different ecological and reproductive roles, separating how their traits are shaped by interactions between their genes and environment is necessary and important. Here, we disentangle the sex-specific effects of genetic divergence, developmental plasticity, social learning and contextual plasticity on foraging behaviour in Trinidadian guppies (Poecilia reticulata) adapted to high- or low-predation habitats. We reared second-generation siblings from both predation regimes with or without predator chemical cues, and with adult conspecifics from either high- or low-predation habitats. We then quantified their foraging behaviour in water with and without predator chemical cues. We found that high-predation guppies forage more efficiently than low-predation guppies, but this behavioural difference is context-dependent and shaped by different mechanisms in males and females. Higher foraging efficiency in high-predation females is largely genetically determined, and to a smaller extent socially learned from conspecifics. However, in high-predation males, higher foraging efficiency is plastically induced by predator cues during development. Our study demonstrates sex-specific differences in genetic versus plastic responses in foraging behaviour, a trait of significance in organismal fitness and ecosystem dynamics.