The two characters in your question bear striking similarities in terms of how they react psychologically to their respective situations. Both become despots as a result of obtaining power and letting the desire for power change their nature. There are naturally differences between them as well due to setting and other factors such as the age of each character. But both characters are examples of the saying that absolute power corrupts absolutely.
Macbeth had merely been a lord and military man prior to the events that take place in the Macbeth play. After the witches plant the idea in his head that he may be destined for king status, Macbeth mentions this to his wife. Lady Macbeth's greed and desire to achieve royal status causes her to drive Macbeth into treacherous deeds in order to make the kingship available. Macbeth himself had not originally aspired to this. But once he was made king, he became paranoid because he had first-hand knowledge of what a person might do to a king if one wanted to usurp the king's job. The paranoia in turn made Macbeth cruel. He could no longer trust former friends, and being king took on a new level of importance to him. As a preventative measure, anyone who might also be seeking the throne or whose descendants were potentially destined to have the throne had to be killed. As a punitive measure, he even arranged the deaths of the innocent people in Lord Macduff's house. This last action shows the extreme change in his personality that has occurred since the beginning of the play. He is no longer a respected member of the noble circle in which he had been, but now a feared, hated, mentally unstable tyrant.
A similar transformation occurs in Jack from Lord of the Flies. At the beginning of the novel when Jack first appears he is leading a small group of his fellow choir boys. He has had some limited leadership experience in his role within the choir. Now faced with a frightening situation in which all authority figures above himself are absent, Jack's method of dealing with it is to act like a sort of captain to any boys who will obey him. Like Macbeth, Jack is at first a respectable member of the community. Jack offers to be in charge of hunting in order to provide food for everyone. Jack is not really interested in participating in Ralph's plan to try to attract rescuers with the signal fire. Jack and his hunters eventually split into their own tribe with Jack as its chief. Days and days of survivalist living have begun to change Jack. Killing animals has become a normal pastime for him, making it ever so much easier to transition to killing people. By the end of the story, Jack has become so crazed with power that he believes it is necessary to kill Ralph. The tribe pursues Ralph through the jungle just as they have done so many times with the wild pigs, and it is certain they will have no problem slaying Ralph if they catch him. Jack, a boy who used to be an upholder of civilized rules and order, is now the orchestrator of murder whose idea of "rules" and "order" are now about controlling other people than controlling a situation. Like Macbeth he has become a feared tyrant. But Jack has also whipped everyone into his tribe into a supportive and murderous frenzy, while Macbeth has nobody left on his side at the end.
As we can see, both characters undergo a psychological shift that replaces desire for order with desire for power. A choirboy is now chief of a war party; a military hero and husband is now a monster that everyone wants dead. While specific motivation and circumstances differ for the two of them, both become willing killers whose distrust and paranoia grow in proportion to the power they have seized.