Some baby sharks know an eat-or-be-eaten world lies outside their leathery egg cases even before they hatch.
That in-built knowledge could lead to developing better shark repellents to preserve both people and dwindling populations of the predators, scientists say.
Baby sharks still in their egg cases sense when predators are near and lie very still in a bid to escape a premature death, research published in the open access journal PLOS ONE says.
Ryan Kempster, a marine neuroecologist from the University of Western Australia, and colleagues say in the paper that adult sharks use highly sensitive receptors to detect electric fields emitted by potential prey.
They found embryos of some shark species employ similar skills to detect potential predators and escape being eaten.
Mr Kempster said that when predator-like electrical fields were introduced to an aquarium containing brown-banded bamboo shark embryos the babies responded by stopping any movement within their egg cases and all but stopping breathing.
However once the embryos learned that nothing bad was happening following that stimulus, their instinctive defence responses decreased.
Mr Kempster says this raised the question of whether adult sharks might get used to a continuous signal coming from shark repellents and so not be deterred by some of the raft of the devices already on the market.
His work has also found anatomical differences between shark species may mean that one shark repellent might not work for all species.
"There are a lot of repellents on the market but really it is hard to say for sure that they work because shark attacks are so rare that the likelihood of someone being attacked - whether they are wearing one or not - makes it hard to see if it is truly working," he told AAP.
"We really want to look into testing current repellents and look at improving them to get some security in whether they do work."
He also runs a shark conservation group - www.supportoursharks.com - and would like to think his research also could help the predators as well as people.
Using shark repellents in the fishing industry could reduce shark biting in catches and maybe stop sharks being unnecessarily being killed in nets and long lines, he said.