1- To save them from the corruption of this world.
2- To save them from a very difficult future trial that they could not handle it they were to live.
So it’s out of his mercy that he takes their life. They dir pure and innocent and go straight to heaven.
3- The infants or believing parents are kept with Prophet Ibrahim (a) or Lady Fatima (a). They take care of them until they are reunited with their parents.