Human milk provides protection against disease for a baby. There are many ways that it does this, much beyond what I can delineate in my non-studying time allotted. So I will start at the very beginning and then continue later.
A vaginal birth allows the baby's gut to be colonized by healthy bacteria which will deter disease by preventing the growth of unhealthy bacteria. #2 provide essential nutrients such as vitamin K. The proper colonization of the gut is why adults take probiotics, which will be another post.
The first milk secreted by the mother after birth is called colostrum because it is soooo different from 'mature' milk. It actually selectively facilitates the establishment of healthy gut bacteria Lactobacillus bifidus along with aiding the passage of meconium, or baby fecal matter that is still sterile from being in the mother, or not yet full of healthy bacteria.
Colostrum has less kcal than mature milk that will be secreted a few days later but has a higher amount of protein, fat soluble vitamins, and minerals. Further, it has a VERY high level of antibodies against bacteria and viruses that may be present in the birth canal.
These secreted antibodies are called IgA (immunoglobulin A) and are fascinating because the act like little pac-men for the viruses and bacteria. They are secreted by the adult gut and are specific for the topography of bacteria, viruses, etc. The immunoglobuns thus grab onto the bacteria or viruses and hold onto them preventing them from infecting you. In the adult, IgA is secreted in the nose, the salivary glands, and throughout the gut along with into the breast milk.
In the second trimester of pregnancy, the human breast fills with inflammatory cells and it is thought that it is for this purpose: to identify and greatly increase the amount of secretory IgA made against any bacteria or viruses present in the environment and therefore protect the baby. Not only that but the degree of protection against organisms causing disease is proportional to the amount of HUMAN milk the infant receives, meaning exclusive breast feeding = greater protection vs diseases that cause diarrhea, nausea, etc. It is well established in the medical community that ingested antibodies from human milk provide gastrointestinal immunity against the following digestive tract/enteric pathogens that cause diarrhea: E. Coli, Salmonella typhirium, Shigella, V. Cholerae, Giardia, rotavirus, C. Diff, C jejuni. Therefore the antibodies in human breast milk in combination with the nutrients that help healthy bacteria survive protect the baby against diarrhea, GI ilnesses, etc.
Further the mother secretes immune cells (lymphocytes, T-Cells) that give specific immunity for bacteria present in the environment to the baby whose immune system cannot yet make those bacteria.