It is the gallic gallicism used as an exclamation. See remove the hat (even if it is not in pronominal 128521; ) .
It's an expression of surprise that shows respect and admiration for something or someone. It is an expression of French origin and simply means "I take my hat off to this". Wonderful, phenomenal, spectacular, excellent.
Castellanization of the French chapeau, hat. With admiration it is an exclamative expression that indicates respect and admiration for something or someone. Among the most affluent and cultured classes of the past the expression was accompanied by the gesture or addition to taking off his hat.