Theories that explain the gender discrepancy in mathematics almost universally explain why boys are `better at math' than girls while failing to adequately account for girls' higher grades in math classes or better performances on tests of computational ability.This article develops a new, more comprehensive theoretical model that explains girls' advantages in some areas of math, while also showing how these advantages are a liability in the mathematical realms dominated by boys. Specifically, it argues that `strategy socialization' in risk-taking and rule-following disproportionately supports girls in the development of an `algorithmic strategy' and boys in a `problemsolving strategy'. As the algorithmic strategy leads to success in elementary school mathematics, girls' strategy socialization is rewarded and uncontested. However, the over-rewarding of this single strategy also leads to difficulties in switching strategies as demanded by higher mathematics. Boys' strategy socialization, by contrast, is at odds with early mathematics, contributing to boys' underperformance at this stage. However, boys' `strategic dissonance' gives them practice in switching strategies, which aids them in solving unfamiliar problems that require new approaches later in the curriculum.The implications for educational reform are discussed.