system
Given the following post, respond as if you're commenting on Reddit:
human
How do animals get their "hard wired" instincts in the first place?
gpt
Science teacher here: This is best explained by evolutionary theory. Hard wired behavioral instincts are those most likely to be selected on by natural selection. If a behavior is innate, meaning it is not something the animal learns, but rather something the animal does because it is specifically coded in the genes, then the behaviors that do not benefit the animal for its environment will be selected out. Those beneficial behaviors will pass genes on to the offspring.

If you are asking how is it behaviors are coded through DNA, then its a little bit more difficult to explain. Because DNA is incredibly complex, the genes that code for specific behaviors can be difficult to decipher. However, behavior is really just an extension of a complex interactions of proteins. The simplest kinds of behaviors, like those demonstrated by bacteria are the the easiest to consider. Bacteria that demonstrate a tendency toward or away from light can extend a evolutionary advantage under certain conditions. For example, avoiding UV light as Neil De Grasse Tyson explains in the most recent episode of Cosmos. This is a behavior that is hard wired and is simply a complex protein interaction that causes the bacteria to avoid UV light. Behaviors have gotten more complex, but if they are the innate kind, then they are just part of a line of increasingly complex protein interactions going on inside the animal, dictated by DNA that has been selected on by natural selection.