Then he manifests the two extreme dangers he underwent. And first, the danger of lashes; secondly, the danger of death.
But he shows the danger of lashes by citing those he suffered from his own, that is, from the Jews. Hence he says, Five times I have received at the hands of the Jews the forty lashes less one. It should be noted that, as it says in Deut. (25:2): "A number of stripes in proportion to his offense. Forty stripes may be given him, but not more; lest, if one should go on to beat him with more stripes than these, your brother be degraded in your sight." This shows that men should... be whipped for lesser sins, yet so that the victim never receive more than forty stripes. But the Jews, to appear merciful, always acted short of the Law, giving less than forty, according as it appeared to them. Therefore, because they hated Paul, whenever they flogged him, they omitted the least possible number of strokes below the Law's limit, namely, giving only one less, i.e., thirty-nine. And this is what he received five times, namely, forty lashes less one.
Source: Commentary on 2 Corinthians