People have always been superstitious about mentioning the name of a dead person. Primitive man thought that by doing this, the dead person’s spirit would be disturbed and it would return to haunt the living.
By wishing for a soul to “rest in peace,” people hoped that the spirit would stay within the dead body.
Today, “May his soul rest in peace” is used more as a sign of respect for the dead person rather than the continuation of a superstition.