Dolphins are known to have what scientists refer to as extra-sensory abilities. They can sense when other dolphins are in trouble and assist them. And it is believed they relate to humans and therefore will also assist humans who are in trouble in the water.
There are many reports of shipwreck victims who have been saved from drowning by dolphins. As fellow mammals, it's possible that we appear similar to them in some way.
There's another explanation as well. Dolphins' sonar can penetrate us and make our skeletons and lungs visible to the dolphin. For that reason, they find pregnant women particularly fascinating because their sonar acts like an ultra-sound scan. They are therefore very aware of the fetus and its heartbeat in the woman's womb. Perhaps they recognize some of these similarities between us and them when it comes to pregnancy.
When dolphins are in the vicinity of a person being attacked by sharks, they will ward them off by repelling them with high-speed blows to the body. It's as if dolphins are aware of the danger humans find themselves in.
Some people believe there is a special bond between humans and dolphins, but scientists say they just react like they would with their own kind.