Alice in Wonderland is definitly based on cards. But, why? There is a lot of symbolism that can connect with a deck of cards. Furthermore, cards were very popular then. From the marching cards to the playing cards that were painting the rose bushes, the cards become a big part of the story.
First up in the story, Alice met 3 cards which are the 2,5, and 7 of Spades. They had planted white roses but the Queen wanted red or she would behead them. This is a chance to add a little about the fact that the powerful can have their wish even if it means murder. It speaks of cruelty under powerful people.
The Spades are representative of gardners. So, yes, the story is based on cards and the reason for it is that it allows opportunity for symbolism, irony, creativity, and to become vocal about issues that could not be blantantly spoken about.