What if Lothair had managed to keep control of the empire after Louis the Pious died?
Thing is, Francia was already undergoing severe troubles during Louis's reigns. His own sons ganged up against him in different configuartion, Frankish nobility wasn't thrilled
at all at the perspective slaughtering itself for any of the Carolingians.
Louis's reign was basically an endless suite of nobiliar/claimants revolt and if he managed to hold it together, make these simply not happening was way out of his possibilities.
After his death, Lothar could even less do so : he ruled only over a part of Francia, and a split of loyalties (roughly, Carolingians agreed that their noble supporters shouldn't have lands in the three regni) made possibility of support unlikely; critically when one of his main ones was Peppin II of Aquitaine that was eventually crushed by Charles.
He may do this with stunning military victories, or well placed assassinations.
"Stunning military victories" wouldn't do it : that's the whole context that was at odds. Even if Louis had the chance to score victories (the guy was far more diplomatical-minded than his father, tough) : against who? Byzantium and Al-Andalus are two big no-no, as hinted by Charlemagne's (or his sons/nephews).
Which let Western Slavic and Scandinavian principalties which prooved being not only hard to crack, but whom own political organisation prevented decisive victories.
It's why his campaigns as an emperor (distinct from the ones he did as King of Aquitaine) were more operations of police at the periphery of Francia : Bretons, Slavs, etc.
Not that outer victories aren't doable : but giving the climate of factionalism at best, civil war more often that Francia knew at this point, Louis wouldn't have the ressources for that.
As for assassinations, you just have to look how bad was Bernard of Italy execution seen by everyone, while it was technically a legit one, to understand how totally-not-suspicious murders would be answered by general revolt, critically with the imperial role being justified both as a legitimacy distributor for nobility, and as a Christian ruler.
It is also set up so that this precedent eliminates the Frankish custom of dividing everything equally among sons, at least for the emperor.
Yeah, it comes often as a proposal, but actually misses a lot the point.
People didn't "choose" to change succession's "laws" because it humoured them.
The concept of primogeniture was unknown when it came to kingship, critically when the Frankish political succession was about dividing the fisc and sharing kingship or at least power : it's heavily hinted nowadays that the political division is more about a
late Roman legacy than "Barbarians being Barbarians".
Eventually, the increasing feudalisation of Francia (partially wanted, or at least needed in order to gain support, by Carolingians) was a greater political factor than succession matter strictly speaking.
Would have it happened out of the blue nevertheless, it would have been opposed by much of the nobility up to rebellion. Even in the unlikely case of a victory (which definitely didn't happened IOTL, as a reinforcement of imperialship was what Louis had in mind), the victor's dominion would have weakened enough to allow a more important and faster crumble before inner and outer threats.
Not that Carolingian Francia couldn't have lasted more than it did with some right changes (an earlier death of Charlemagne, making the OI of 806 being applied, with three kingdoms without clear overlordship from Francia?). But the crises of the IXth : increasing feudalisation, outer threats (Vikings, Slavs, Arabs), probable climatic changes, and economical crisis in Arabo-Islamic world weren't really giving room for Francia to hold untouched : rough times were going, no matter what.
I believe you'd have more chances with a Carolingian dynastic system lasting on, by that I mean different kingdoms ruled by Carolingians or Half-Carolingians (as some kings of Wessex) forming a metapolitical ensemble. It would be hard to achieve, and relatively unstable...But less than keeping Francia as it was in 814.