The scandalous sex ratio behaviour of Melittobia wasps has long posed one of the greatest problems for the field of sex allocation. In contrast to the predictions of theory, and the behaviour of numerous other organisms, laboratory experiments have found that Melittobia females do not produce less female-biased offspring sex ratios when more females lay eggs on a patch. We resolve this scandal, by showing that, in nature, females of M. australica have sophisticated sex ratio behaviour, where their strategy also depends upon whether they have dispersed from the patch where they emerged. When females have not dispersed, they will be laying eggs with close relatives, which keeps local mate competition high, even with multiple females, and so they are selected to produce consistently female-biased sex ratios. Laboratory experiments mimic these conditions. In contrast, when females disperse, they will be interacting with non-relatives, and so they adjust their sex ratio depending upon the number of females laying eggs. Consequently, females appear to use dispersal status as an indirect cue of relatedness, and whether they should adjust their sex ratio in response to the number of females laying eggs on the patch.