How do the cards work?
You're probably talking about Tarot cards. 

Tarot cards are occult magic cards used for telling fortunes and predicting someone's future and upcoming events in life. Mystics and magicians use them as part of their image. It's not exclusive to anime, you can see them in real life, western cartoons, movies and tv series. They're kind of like Magic orbs/crystals and Ouija boards.