Playing cards were invented in Imperial China as early as the 9th Century, according to scholarly consensus. The first references to card games appeared during the Tang dynasty when the writer Sy E described the daughter of the Emporor Yuzong of Tang, Princess Tongchang, playing a "leaf game&qout; in 868 with members of Wei clan.
Playing cards first spread throughout the Asian continent before coming to Egypt, where some of the oldest surving cards in the world originate and are found in the Keir Collection in the Benaki Museum. These cards are dated to the 12th and 13th centuries. It wasn't until around the 14th Century when playing cards first entered Southern Europe, most likely from Mamluk, Egypt.
The card game Karnöffel is through to have preceeded or inspired the tarot deck and is the first card game with which the rules are recorded. The oldest surving examples of the tarot pack are dated around the mid-15th Century in Milan. It is thought that tarot originated in Italy by adding a fifth suit to the italian deck called trionfi (triumphs) where they can beat any of the other four suits and is quite likely whre the origin of the word "trump" originates.
The suits used in the old Latin cards were gradually replaced as they spread from Italy to the Germanic countries from the 15th Century, eventually ending up with the suits that we are familiar with today. It was also during this time when the Europeans changed the court cards, starting with the King, with Knights and Knaves appearing in some regions. The Queen made sporadic appearences within packs during the 15th Century.
The Knave was often called the Jack during the 17th Century, a name borrowed from the card game All Fours, that was considered a game for the lower classes, from the English Renaissance where the term Jack was considered vulgar at one time. However, as card indices started to be used more often a formal change from Knave to Jack was encouraged for the English language packs to help differentiate it from the King.
At the end of the 18th Century reversable court cards were invented. These were patented in Great Britain in 1799 by Edmund Ludlow and Ann Wilcox. Reversable court cards meant that players no longer had to turn the cards upside-down, something that previously often led to giving other players a hint of what might be in your hand. This was one of the changes that, by the end of the 19th Century, resulted in the cards evolving into a form that resembles the modern playing card decks that we see today.