A lot of humor is about making unseen or subtle connections, and bringing out things that are hidden, perhaps out of embarrassment or cultural values.

Wisdom is about these very things, things of awareness, inner perception, and making connections. Therefore wisdom helps humor.

Also, a Soul who is wise is also more sensitive, picks up more things, and more subtle things. That also helps. I've never seen someone with a great sense of humor who was also not extremely sensitive inside.

Finally, wisdom by its nature tends to be one step ahead. Like humor.