Jokers are one of those funny things -- many decks don't have jokers, and in most cases you can lose the jokers and it doesn't matter. So why include them? And while we're on the topic, where did any of the cards in a deck come from? Why are there 52 cards, with four suits and 13 cards to a suit?
According to Britannica.com, the 52-card deck that we use today is a modification of part of the standard Tarot deck, made up of the Major Arcana and Minor Arcana, minus the knight cards. Probably around the 15th century, the deck started settling into the modern form we know today.
The joker, however, did not appear until sometime around the 1860s. At that time, the game of euchre was extremely popular (it was later unseated by bridge). In euchre, under the British rules, there is a card known as the Imperial Bower (or Best Bower) that trumps all others. Decks of cards began to include a special Imperial Bower card, and it later morphed into the joker card that we know today.
According to this page:
These links will help you learn more: