If you are thinking of the self-immolating monks of Tibet, it's to gather attention for a political cause.
It's worth noting those monks are not garden-variety mortal human normie beings.
Their concentration is so beast strong from decades of training, they can in fact block out the sensation of pain absolutely.
They sit still like stone statues while burning alive.
Like imagine touching a hot stove, and holding your hand there for 30 seconds.
Now imagine that pain over your whole body, and not moving a muscle.
This is utterly impossible, but they can do it with their mind over matter power of concentration.