The modern term means jesting, but originally "wit" meant knowledge. In a court trial, somebody who had knowledge in the case might be called to give his wit-ness. The resemblance between wit and humor has been lost.