Suddenly our little children's story is getting heavy with the social implications. And the picture of class isn't exactly painted in a happy-go-lucky color, either. The rules are definitely set up in The 500 Hats of Bartholomew Cubbins to favor the King and his kin, followed by each successive step down on the social ladder. The King is rich and powerful, and can order the arrest and subsequent execution of a boy simply for not removing his cap. Everyone else has to follow the King's orders and act on the King's whim, regardless of reason.
With that said, the ending brings a certain sense that Bartholomew sticking his principles will see him safely through society's class trap. No, he doesn't become King, but the King owes him a couple gold coins. And maybe that's the best he can hope for.
Questions and Answers
Q: How come the King can command everyone to take off their hats or send them to be beheaded?
A: Because he's the King, and Kings get to do that.
Q: But why?
A: Because this society is built in a way that allows Kings to make those decisions. They are on the top of the social pyramid.
Q: But why?
A: Generally speaking, because the Kings have the most money or own the most land or control the most resources or all of the above.
Q: But why?
A: Um…. let's go boot up the computer. It's time to Google.