Some boys are bad at math and so are some girls. The overlap is much larger than the difference. Overall, sex differences tend to be smaller than most other demographic differences. Girls are much less apt than equally talented boys to go into math-related careers including engineering and the physical sciences. There is a biological basis for sex differences in math.
Hormones cause everything.
Parents have lower expectations for girls in math and science. Girls learn better from female teachers. Some male teachers feel that it isn t possible to reach girls so it isn t necessary to try. Some adults and students feel that girls avoid classes taught by men. It is the quality of the teaching, not the gender of the teacher, that matters.