We discuss evolutionary perspectives on two neurodevelopmental disorders: attention deficit hyperactivity disorder (ADHD) and autism spectrum disorder (ASD). Both have a genetic background, and we explore why these genes may have survived the process of natural selection. We draw on the concept of evolutionary mismatch, in which a trait that may have conferred advantages in the past can become disadvantageous when the environment changes. We also describe the non-genetic influences on these conditions. We point out that children with neurodevelopmental conditions are more likely to suffer maltreatment, so it is important to consider both the genes and the environment in which children have grown up. In huntergatherer societies, ADHD may have favoured risk-taking, which may explain why it has survived. The contemporary model of schooling, in which children are expected to sit still for many hours a day, does not favour this. Understanding ADHD in terms of an evolutionary mismatch therefore raises ethical issues regarding both medication and the school environment. ASDs are far more heterogeneous and are characterised by high heritability and low reproductive success. At the severe end of the spectrum, ASD is highly disadvantageous and often co-occurs with intellectual disability. On the other hand, high-functioning ASD may have been adaptive in our evolutionary past in terms of the potential for the development of specialist skills and can still be so today in the right environment.