The style of the novel is playful but also logical. For example, in Chapter 12, Alice wants to speak to Kitty and remarks on how much more convenient it would be if cats had a way of saying "yes" or "no":
It is a very inconvenient habit of kittens (Alice had once made the remark) that, whatever you say to them, they always purr. “If they would only purr for ‘yes,’ and mew for ‘no,’ or any rule of that sort,” she had said, “so that one could keep up a conversation! But how can you talk with a person if they always say the same thing?”
On this occasion the kitten only purred: and it was impossible to guess whether it meant ‘yes’ or ‘no.’
The idea that cats could purr to say "yes" and mew to say "no" is whimsical, and yet it makes perfect logical sense that this system would be convenient. Alice spends much of the novel encountering whimsical or silly scenarios and trying to logically piece them together, often through a simplified version of formal logic (such as the "if/then" statements that are part of this passage). Her perspective as a child makes her very open-minded and ready to accept all kinds of strange occurrences and word-play, as long as she can make some kind of sense of what she is encountering. Still, the passages where she thinks through the logic behind situations and nonsense words or phrases often end up nowhere.
Carroll's combination of outlandish nonsense and fruitless logic does not simply bring Alice to life as an inquisitive child. Additionally, it makes a point about the failures of logic as a practical framework for understanding the real world. As a work of nonsense literature, Through the Looking-Glass is constantly trying to disorient the reader and bring assumptions about the world and its norms under examination. For example, Alice's understanding of real-world dinner party etiquette is unhelpful to her when she is trying to host her own outlandish dinner party in the Looking-Glass World. Although this dinner party seems to have different and constantly-shifting rules, most real dinner parties are also dynamic affairs where people behave unpredictably. Etiquette provides a certain logic by which dinner parties are supposed to operate, but it might be more effective to simply accept that things will happen as they happen. Like Alice finally accepting that she is not going to get a "yes" or "no" out of Kitty, Carroll suggests that we would all do well to stop trying to decipher the world.