How prejudices are transmitted from generation to generation

It is a common misconception that boys are better at math than girls. How exactly does this misconception spread?