Why did evolution create a chicken that lays so many unfertilized eggs when that is so wasteful?
Natural evolution did not create a chicken that lays so many unfertilized eggs. Human engineering created such chickens. You could call the process "human-caused evolution", "artificial selection", or "selective breeding". The evolutionary principles of survival of the fittest and inheritance of genetic traits still apply in artificial selection, but the agent that determines who is the fittest is a human and not a natural environmental pressure. In selective breeding, humans choose only the individuals of a species that have desirable traits to use as parents for the next generation. After several generations of selective breeding, the organism gains more and more of the desired trait. It's not that the humans are training or teaching the organism to have the desired trait. Rather, genetic mutations cause the next generation of individuals to have a variety of new traits (the "new traits" are typically very small modifications when looking at just a single generation). Most of the mutation-caused traits are undesirable or irrelevant. But the few organisms with desirable traits are selected and used to create the next generation.