A cumulative tale. I'm not someone who thinks all books have to teach kids something or have a good lesson/moral at the end, but I wasn't a fan of the way this story resolves. It seems to boil down to just know the right people and you'll get what you want.
I will say though I do not have the cultural knowledge to understand the context of this tale, so there's definitely a chance I have misinterpreted it and that my understanding is completely wrong.