Parental care is extremely diverse but, despite much research, why parental care evolves is poorly understood. Here we address this outstanding question using egg attendance, the simplest and most common care form in many taxa. We demonstrate that, in amphibians, terrestrial egg deposition, laying eggs in hidden locations and direct development promote the evolution of female egg attendance.Male egg attendance follows the evolution of hidden eggs and is associated with terrestrial egg deposition but not with direct development. We conclude that egg attendance, particularly by females, evolves following changes in reproductive ecology that are likely to increase egg survival, select for small clutches of large eggs and/or expose eggs to new environmental challenges. While our results resolve a long-standing question on whether reproductive ecology traits are drivers, consequences or alternative solutions to caring, they also unravel important, yet previously unappreciated, differences between the sexes.