2 of 7 corrected emphasis and grammar

How did Hermione ended up being the Minister for Magic?

I don't like the Cursed Child at all, but since JKR has confirmed that it's a canon, can someone tell me how Hermione ends up as Minister for Magic? It's quite evident that she probably has the educational qualifications and skills required but she hasn't really shown having great leadership or diplomacy skills, which, even as a Minister for Magic, is something extremely necessary to have.

Moreover, in Chapter 7 of Deathly Hallows (The Will of Albus Dumbledore), when Scrimgeour suggests that she should purse a career in Magical Law, she retorts that she wouldn't because she "wants to do some good to the world".

So, after two books of hating the way the Ministry actually functions, why did she want to take charge? This seems pretty out of character to me.