Probably because Nigel is such a smart, confident little boy, and because Miss Trunchbull feels threatened by people who are clever, she really doesn't like him. She's also obsessed with cleanliness, but Nigel is a messy kid. So, she wants to scare him, bully him, and make him submit to her, but he won't.
When Miss Trunchbull visits Miss Honey's class to take over the lesson one afternoon after lunch, Miss Trunchbull and Nigel have a very tense conversation during which Miss Trunchbull wants to
- force Nigel to be polite to her and address her by her name after every sentence he says aloud;
- make Nigel admit, because his hands are dirty and he has a bean on his shirt, that both Nigel and his father are filthy, stupid people;
- banish Nigel from her sight, making him remain in the corner, faced away from her, while standing on one foot;
- and embarrass Nigel and his class by proving that they are bad at spelling.
Of course, Nigel is so clever that he absolutely does not let Miss Trunchbull get the better of him. In fact, toward the end of the story, when Miss Trunchbull faints, Nigel is the one who gleefully douses her with a pitcher of water--essentially scoring a victory over her.