Sunday's episode of The Walking Dead ended with Maggie (Lauren Cohan) making the controversial decision to execute Gregory (Xander Berkeley), following his failed attempt to have her killed. In choosing not to give Gregory another chance, Maggie demonstrated that she has no intention in being anything like Rick (Andrew Lincoln), and that isn't necessarily a bad thing.
At the beginning of The Walking Dead season 7, Rick made a solemn promise to kill Negan (Jeffrey Dean Morgan). After spending a season in servitude to the Saviors, Rick began to lead the other communities in revolt, and by the end of season 8, Rick gained the upper hand against Negan. During the season finale, Rick finally had his chance to make good on his promise, but shocked everyone by sparing Negan's life in the hope of fulfilling his late son's dream for a better world. Instead of killing Negan, Rick chose to keep Negan prisoner as a way of setting an example for other communities.
In The Walking Dead's season 9 premiere, it was revealed that Maggie earned her job as leader of the Hilltop by winning an election against Gregory. However, Gregory didn't get over his loss and secretly plotted to kill her by manipulating a man who lost his son in the trip to Washington D.C. His plan failed, and to retaliate Maggie arranged a public execution for Gregory. Maggie admitting that killing Gregory wasn't something she wanted to do, and something that she hoped she wouldn't have to do again, but emphasized the fact that Gregory had already been given several chances to change his ways.
Gregory's execution came after a speech Maggie made to Rick about being a leader and choosing not to help the Saviors unless the Hilltop were to receive something in return. Maggie's speech and Gregory's execution sent a clear message to Rick that Maggie has her own ideas about how to lead her people. Though Rick feels that sparing Negan was the right choice, he has no reason to expect Maggie to follow his example. Maggie has her own people now, and is no longer a part of his group, which means Maggie is free to lead in the way that she sees fit.
Maggie's reasoning also makes a great deal of sense. If Gregory's action in the premiere has proven anything to Maggie, it's that no matter what happens, he will never change. Maggie believed that killing him was her only option. Letting him live would have only created more problems for the future. Maggie's decision prevented all of that, in stark contrast to what Rick has done with Negan. Maggie could end up being right about Negan too, considering that Negan may soon reemerge as a threat.
In earlier seasons of The Walking Dead, no one would have faulted Maggie if she had killed Gregory immediately, but with everyone trying to build a civilization, Maggie tried to do the right thing by settling the matter in a more civilized way. In executing Gregory, she showed people the consequences of breaking the rules. In doing so, Maggie is proving to be both a strong and capable leader for the Hilltop.