The placebo effect is when a person takes something they believe is medicine for an ailment they are suffering, and they get better. A placebo is an inert substance, and when taken makes the person get better, simply because they were expecting or believed that it would work.
Something similar, called the nocebo effect, is when a person takes fake drugs and thinks they are experiencing problems that would have been caused by the real drugs. They have been known to reduce pain as well.
Why they occur is mysterious and they are only one of the many complicated things related to the body-brain connection. In fact, our own bodies hold many unsolved mysteries.