The Walking Dead hinted at Maggie's return in the season 9 finale, "The Storm". Last summer, it was revealed that not only was Andrew Lincoln exiting The Walking Dead as Rick Grimes but Lauren Cohan was departing the show as well. While Rick had been on the show since the very first episode, Maggie is also one of The Walking Dead's leading characters, having first appeared in season 2 and remained a series regular through season 8. But things had changed in season 9.
Even though fans knew Cohan would be leaving The Walking Dead during the first half of season 9, they didn't know in which episode. It was only after the six-year time jump that viewers realized Cohan had exited The Walking Dead in the same episode as Rick, "What Comes After". Then, in season 9 episode 7, "Stradivarius", a conversation between Alanna Masterson's Tara and Tom Payne's Jesus reveals that Maggie was off with Georgie, forming a new community. Maggie's name popped up a few more times throughout season 9, but she never resurfaced. However, the season 9 finale may explain how Maggie can come back in season 10.
Taking place months after The Walking Dead's fair episode, "The Storm" sees Ezekiel's people abandon the Kingdom and travel to Hilltop, where Yumiko appears to have taken up a council position. After losing Gregory, Jesus, and Tara, Hilltop was unwilling to elect a new leader. When Michonne asked about Maggie, Yumiko said they hadn't heard from her but they sent her another letter, presumably explaining the entire situation. With that, Yumiko has opened up an avenue for Maggie to reappear.
With one Hilltop leader killing another one (Maggie killing Gregory early in season 9) and then Hilltop losing its latest two leaders (Jesus and Tara) to the Whisperers, it's understandable that they would be apprehensive to electing someone else, especially if there's a good chance they could be killed by Alpha and her group. But when Maggie hears of what's become of the Hilltop, and that Jesus and Tara had been killed, then she may come back to Hilltop to lead them out of this perilous situation, just as she helped them defeat the Saviors in the seasons prior.
Cohan's exit from The Walking Dead was ultimately due to a contract dispute, so it's not equivalent to why Lincoln decided to leave, as he wanted to spend more time with his family in the UK. Dedicating the vast majority of the year to filming The Walking Dead in Georgia simply wasn't an ideal choice for him anymore. Cohan, on the other hand, appears to be more than willing to eventually return to The Walking Dead in season 10.