Practical joke - origin of the term?

What is the origin of the term “practical joke”? It’s not clear to me what the “practical” part of the joke would be.

Practicus, in latin, means “pertaining to action.”

A joke that is done rather than told. Seems obvious to me…

Boy, you two really fell for that one!

Practically.

“I could out-pedant you with one arm tied behind my back!”