Wikipedia:
" A Jack, Lancer or Knave, in some games referred to as a Bower, in Tarot card games as a Valet, is a playing card which, in traditional French and English decks, pictures a man in the traditional or historic aristocratic or courtier dress."
"The earliest predecessor of the knave was the thānī nā’ib (second or under-deputy) in the Mamluk card deck. This was the lowest of the three court cards, and, like all court cards, was depicted via abstract art or calligraphy. When brought over to Italy and Spain, the thānī nā’ib was made into the fante (an infantry soldier) and the sota (a page), which ranks below the knight card. In France, where the card was called the valet, the queen was inserted between the king and the knight. The knight was subsequently dropped out of non-Tarot decks, leaving the valet directly under the queen. The king-queen-valet format then made its way into England.
As early as the mid-1500s, the card was known in England as the knave, which originally meant ‘boy or young man’, as its German equivalent, Knabe, still does. In the context of a royal household, it meant a male servant without a specific role or skill; not a cook, gardener, coachman, etc. The French word valet means the same thing.
The word ‘Jack’ was in common usage in the 16th and 17th centuries to mean any generic man or fellow, as in Jack-of-all-trades (one who is good at many things), Jack-in-the-box (a child’s toy), or Jack-in-the-Pulpit (a plant).
The term became more entrenched in card play when, in 1864, American cardmaker Samuel Hart published a deck using “J” instead of “Kn” to designate the lowest-ranking court card."