Chaotic population dynamics can result from natural selection