Natural selection. The trait that is unfavorable to the baby giraffe's survival will cause the death of giraffes with that specific gene that is responsible for a short neck vs a long neck. Natural selection causes traits that help the survival of the species will be carried throughout generations while unfavorable traits will be lost.