Even when a person suffers pain in consequence of a thorn having entered into his hand, although it is at once drawn out, it is a punishment that has been inflicted on him, and the least pleasure he enjoys is a reward; all this is meted out by strict justice; as is said in the Scripture, "all His ways are judgement" (Deut. xxxii. 4); we are only ignorant of the working of that judgement.
Moses Maimonides (2016). “Guide for the perplexed”, p.1088, Moses Maimonides
