The answer to the question is that the behavior is an example of overproduction. A frog needs to lay thousands of eggs because so many of them die in the process of hatching to tadpole stage to frog. A frog lays so many eggs in the hope that a few of them will be able to reach adulthood and be able to reproduce the species in the future.