We can think of the brain as having latent programs. Some of them running continuously in the background and others only triggered when needed. All of them, at a very base level, have to do with survival, or at the minimum, survival of the species.
The more immediate the survival needs are the more immediately the program takes over and the more difficult to override. And the more it overrides other programs.