The oldest known Tarot deck dates back to mid-1400's Italy. At first the cards were used to play a card game similar to the modern game of eucre, where certain cards and card combinations trumped other cards. It is believed that the oldest decks contained only the numbered and court cards, not the highly symbolic "Major Arcana" that separate today's Tarot deck from an ordinary deck of cards.
The Major Arcana cards were added to the deck gradually as additional trump cards, but somewhere around the mid-1500's these allegorical scenes began to be used in fortune telling.
The Vatican during this period was a place of political intrigue and backstabbing, and there was a lot of spying and subterfuge. The cards were sometimes used to pass information between parties secretly by speaking in symbols as part of a 'reading'. The cards could also be used to pump people for information without them knowing that's what was happening, and for spying (in much the same way.)
Claims that the cards originated in ancient Egypt are likely false, and possibly came about as the cards became more associated with the nomadic Roma peoples of Europe and with fortune telling.
Pamela Coleman Smith and Arthur Edward Waite created one of the most popular decks, the Rider-Waite Tarot, in 1910. Their deck is associated with the neo-Pagan revivals and Spiritualism of the turn of the twentieth Century. Aleister Crowley also designed his own deck around this time.
Carl Jung found merit in the cards as instruments that allowed the deep psyche and its contents to be projected outwards and interpreted. I think the cards are used well this way, but in my experience people tend to take them over-seriously and think they are magic no matter how you explain it to them. I can see how they could have been used in the past for exploitive and political ends.