Well it's a common trope in fantasy that we are in a medieval setting and of course every medieval setting must have an authority figure of some sort, and that of course is the king.
Here is an appropriate music video to get you psyched up and thinking about kings:
Awesome music aside, it's rather telling we are always thinking of kings in fantasy setting. It's actually very unusual in human history to see anything but some variant of the king-vassal relationship in politics and daily life. Our modern political system is less than a few hundred years old, and would be seen as phenomenal (or idiotic) by most previous societies on earth.
In fantasy though one can always count on seeing the good/evil king sitting on his throne surrounded by scheming lords and advisers in his court. Unfailingly we see the fates of kingdoms resting in the hands of plucky heroes, we see crowns being won and lost, and we see kings as characters and come up with the issue of ruling.
Though some must ask; why all the time kings? Can't we see emperors, samurai, daimyo, caliphs, sultans, chiefs, viziers, and pope's engaged in such situations as well?
My answer is that of course we can, there just seems to be a lack of them out there.
I personally doubt that it has anything to do with uninterested authors or less than receptive audiences, but in reality most likely has more to do with that all these titles and positions of authority, in varying degrees to one another, can be summed up under that millenia old word and phrase for a ruler, and that is king.
The title of king is of course one that could be easily translated into many languages or extrapolated from whatever word locals use to call their ruler. The position, and the authority that rests with it, is going to be much the same. Whether a sultan ruling from a palace in India, or an African chief ruling over a great swathe of the Savanna with his warrior armies, the position, power, duties, and authority is going to be very similar to what we would consider a king.
In writing of course this can get cliche to some people, but I tend to disagree simply because of the powers and duties any ruler (no matter what title we give him) will have when it comes to making himself the leader of a pre-industrial (or even post-industrial for that matter) nation. Slapping a fancy made up word on the position is not going to hide the fact that this person is for all intents and purposes, occupying the same position as a medieval European monarch.
This of course should not discourage authors from trying something new and attempting to experiment with the accepted idea of how kings rule and set up authority. Writers should by all means attempt to subvert and play with the tropes we've long accepted as part of the fantasy genre, and we should be seeing people experiment with different political systems and theories for setting up how kingdoms run and govern themselves.
From the Confucian principles that governed Imperial China, to the religious inspiration that justified the rule of the Caliphs across the Middle East, it's important for writers to set their sights on other modes of ruling and how a ruler gets his authority and how a vassal is beholden to him.
While I've heard some authors say that its hard to keep people interested in a character once he becomes king (S.M. Stirling famously saying that it's boring because its all meetings and reports) and that they lose much of the action and drama that could be presented I have to strenuously disagree! In fact in my humble opinion, once a character becomes king and faces the difficulties of ruling it can become a defining moment in a series!
They have to deal with plots, counter plots, swirling alliances and petty grievances, marriage proposals, siring heirs, leading armies in battle, managing the affairs of the kingdom, dodging assassins, and in a fantasy setting this can be offset by some more mystical elements being thrown in! It's sad that some authors seem to miss this. You don't necessarily need a king to be a main character, they can just be secondary characters sitting off to the side advising or hampering the main character.
For instance look at King Elhokar from The Way of Kings by Brandon Sanderson. Elhokar is a young paranoid king who rules a nation mostly in name but still has the power of his office. He is a supporting character to Dalinar (one of the main characters) and at times both helps and hinders Dalinar's actions. He is hardly boring and has a number of fascinating character tics which make him function well and give him a distinct personality.
Then just look at the in depth look at kingship and authority which A Song of Ice and Fire gives to us. We go from kings who are bad to kings who are not so bad in a brief time. The story looks at people who do have power and agency (much like a king would) and shows that despite the fact they still have to deal with petty politics and somewhat mundane matters (Eddard hearing petitions from smallfolk and lesser nobles was a scene which I've heard some people found tedious) but duly demonstrates that showing a man of authority in action shows off his character through how he carries out those actions. Stannis is another good character to show that kings are not all just dull reports and meetings, but people driven by a call to action and a personal sense of justice. Though we haven't seen any POV's from him yet, we have seen his character in action on the Game of Thrones television show which truly helps get a feel for the man and what he does.
In Joshua Johnson's The Cerberus Rebellion we get a POV from the point of view of King Eadric who is the character that starts off the book. Here we see the character of the man who rules the nation. He is far from a boring character and his varied attitudes towards his advisers and vassals is one which frames his interactions with the rest of his realm. We get to see he is a 'big picture' person who looks at the larger issues in his realm while neglecting his vassals smaller needs seeing them as irrelevant to his plans as a whole. This of course is what ends up getting him in hot water.
For another fabulous POV of people who eventually become rulers one need look no further than the Wheel of Time by Robert Jordan. There are many characters who are (or become) rulers in their own right and they were some of the most fascinating character arcs I'd ever read.
So personally I think having a ruler as a main character is something that can really be used well in a piece of fiction, whether you are examining the authority and rights of rulers, or simply making them characters in the grand scheme of things its fascinating.
All in all kings are force in fantasy that will be sticking around for quite some time, whether we call them emirs or shogun is a matter of semantics in terms of what force the character represents. They may be heroes, they may be villains but they capture the romantic vision we have of epic fantasy and they do it quite well.