Came here to say that it's not necessarily in our head - you can knowingly get a placebo and still react to it. As far as I know it's a combination of head, genetics and other unknown factors. In my opinion an underappreciated and understudied field.