The placebo effect comes from social support and goes beyond pain.
As for the implementation details, expectations play a role. A drug that modulates the cholecystokinin neurotransmission in the brain (involved in expectation processing) was found to enhance the placebo effect of a placebo pill (on mobile, can’t search right now, but with “ cholecystokinin” and “placebo” you should find the paper on google scholar).