The central lesson of the book is that witches look exactly like ordinary women. Dahl deliberately creates unease around the idea of judgement by appearance. This theme is aimed at teaching children (and adults) to look beneath surfaces.
As a mouse, the boy is tiny and vulnerable — but he achieves what no adult could. Dahl recurrently gives power to the small and powerless.
Grandmother loves the boy entirely as a mouse. Her famous speech — that a mouse-child with a wonderful grandmother is luckier than a human-child who is unloved — is one of the most moving passages in all of Dahl.
As with most Dahl novels, the moral lines are clear: witches are evil, the boy and his grandmother are good. The novel ends not with all danger eliminated but with a plan to keep fighting — suggesting that evil must be actively and persistently opposed.