The OED has an entry for this use of the:
a. Used with a following comparative adjective or adverb to emphasize
the effect of circumstances indicated by the context.The circumstances
are sometimes expressed by a phrase introduced by for, e.g. he is
much the better for it, he looks the better for his holiday.
1724 Modest Def. Publick Stews 51 She will be the easier bribed,
when Love and Avarice jointly must be gratified.
1782 W. Cowper Mutual Forbearance in Poems 24 Your fav'rite horse
Will never look one hair the worse.
1838 J. Ruskin Ess. Music & Painting §24, in Wks. (1903) I. 285
And if others do not follow their example,—the more fools they.
1883 Law Times 27 Oct. 425/1 What student is the better for
mastering these futile distinctions?
1938 Manch. Guardian 8 Mar. 8/1 This record is the more remarkable
when we remember the defective eyesight by which..Dr. Garvie has been
handicapped.
2014 K. Fforde Christmas Feast 289 She wouldn't really be any the
wiser.
There is also a discussion of this in the Cambridge Grammar of the English Language p1131-1132
i This didn’t make her achievement [any the less significant].
ii In the Swedish context, notable for its tradition of peace and
non-violence, the senseless futility of this act stands out [the
more starkly].
iii The plight of the four British employees greatly perturbed
Urquhart, [the more] because a request to the Governor for a
contingent of Cossacks to escort them to safety had been turned down.
iv The result is [all the more disappointing] because she had put
in so much effort.
v That’s [all the more reason to avoid precipitous action].
vi He went prone on his stomach, [the better] to pursue his
examination.
The here modifies the following comparative (more, less, better), forming a phrase which in turn is modifier to an adjective ([i/iv]),
an adverb ([ii]), a verb ([iii/vi]) or determiner to a nominal ([v]).
In [i-ii] the is freely omissible. In [iii] the underlined
occurrence of the would be omissible if it introduced a modifier
rather than a supplement (which would mean dropping the comma), but
not as it stands. In [iv], all the might be glossed as “even”, or
all the+ comparative as “especially”; the can only be omitted if all is omitted too. Example [v] is similar, except that all the more is here a DP functioning as determiner in NP structure. In [vi]
the better is a fronted modifier in the infinitival clause of purpose; the is obligatory in this position but optional in the
basic position - compare in order to pursue his examination (the)
better.
The is completely excluded if the secondary term is expressed: *The result was the better than I had expected. Nor is the permitted
when the secondary term is recoverable anaphorically, from what has
gone before. We cannot, for example, insert the in It was cloudy
and cold for the first two days but on the third day the weather was
better, where we understand “better than on the first two days”.