I think it has to have something to do with the curse. Rumplestiltskin created it before Emma and probably Snow were born, but he said Emma could break it. I think he must have done something with the hairs which would be her DNA or at least her DNA source to key the curse to her. If not I can’t see how he would know an unborn child would break the curse. Just a theory.