system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How come mammals are the only animals that produce milk? And not other animals (such as birds, fish, reptiles, amphibians, etc)?
gpt
Because it is part of the huge risks mammals take on with live birth. All the animals you listed don't really take care of their young with the exception of birds and some species of the others. The reason for this is because it doesn't take much energy to develop and lay eggs so you can produce a lot of eggs and just lay them forget about them and hope some of your offspring make it but if not hey you got another mating season.

Live birth is different, you have to carry your baby to term and have it develop which is a huge investment in resources and time and could potentially put you in danger by affecting your running performance, hunting performance etc. and if you fail in raising your young or making it to term with the pregnancy you must wait for the next mating season and wait for the process of developing young all over again. So a way to help guarantee that your young will grow up is to give them milk, a super energy dense liquid to help your young get the energy it needs and hopefully survive since you already spent all this time investing in your young you should invest some more so it didn't go to waste.

Also just compare the number of young produced and you will see why live birth is risky. The biggest litters are produced by the simplest mammals with the biggest being from tailless tenrecs with an average of 15. That's pretty average for reptiles and amphibians usually lay hundreds of eggs.