One Piece's story being in a constant loop of war had been a fan theory for a long time. The recent Elbaph arc essentially confirmed the fan theory, making it clear that a war against the World Government already occurred two times before, with the current story taking place on the eve of the third war.
Although not much about the previous eras is known, it is clear that the animosity between Imu and Joy Boy shaped the world during the past eras. While numerous attempts have been made on Luffy, and by extension, Joy Boy's life, it is possible that Imu orchestrated the beginning of the Great Pirate Era to expedite Joy Boy's ascent. This may have been done to close the cycle of war and rebirth, within which the current world is confined.
Disclaimer- This article contains spoilers for the One Piece series.
One Piece: Luffy's journey and Nika's arrival might've been Imu's scheme all along

The murals of Elbaph, alongside the Harley texts, have recently confirmed the looping nature of the world. Evidently, the entire world is in a constant loop of war between absolute authority and absolute freedom, marked by Imu and Joy Boy, respectively.
While the actual outcome of the previous two wars has not been completely revealed, both of them ended with Nika changing the world—once by liberating it and once by destroying it—as evident in the confusion around Nika's actual role.
Although numerous attempts on Luffy's life have occurred, all of them have been intentionally or unintentionally orchestrated by the Gorosei and not Imu. Given that most of the Gorosei take action in Imu's interest without proper consultation, it leaves the possibility that Imu did not know of the numerous attempts.

Imu stripping and essentially executing Saint Saturn following the failure of the Egghead Island Buster Call also makes it clear that the Gorosei aren't too integral to Imu's final plan.
It is possible that Imu's entire plan is to conclude the constant war against Joy Boy for the final time. Given that the three eras conveniently line up with the three-act structure of storytelling, the entire 900-year period between the Void Century and the present time might've been Imu's preparation period for the conclusion of the entire war.

Although the fight between Imu and Joy Boy ended without a proper conclusion the first two times, Imu might've just started the Great Pirate Era to hasten Joy Boy's growth in power, putting an end to the 900-year preparation for the final war.
While the numerous assassination attempts on Luffy discredit Imu's plan of the final showdown, the overall tension and lack of communication between Imu and the rest of the government make it clear that Imu's plan isn't even fully known to the Gorosei.
Final thoughts
One Piece chapter 1142 will be released on March 9, 2025, and will mainly focus on the Holy Knight's assault on Elbaph. Loki's shackles also came loose in previous chapters, so the actual fight between Loki and Luffy may begin very soon, amidst the plans of Elbaph's destruction.
Related links-
- One Piece chapter 1142 release date and time
- Did Shanks set up Luffy to free Loki in One Piece? Explored
- Everything One Piece has revealed about Scopper Gaban so far, explained
- 4 darkest One Piece arcs (& 4 that are the most lighthearted)
- All known Holy Knights in One Piece, explained