Instincts as the direction of evolution
Instincts (high-level algorithms) define the direction of evolution.
An inherited instinct repeatedly makes animals behave in a particular way. That behavior favors some inherited traits over others. Over generations, the accumulated changes can shape a lineage and eventually contribute to the formation of new species.
For example, all members of the order Carnivora share a common ancestor. That ancestor may have had an inherited drive to attack, which could have shaped the evolution of its descendants, even if some of them later changed their diet.
Likewise, a mutation that lets you swim better is not very useful to those who hate water.
Many other examples can be provided, but I’m not here to die on the biology hill.
In short, your behavior changes which inherited traits are favored, just as your environment does. It’s an additional evolutionary pressure.