I used to believe that Whitebeard was the strongest in the world, including stronger than Roger, but after the recent flashback I'm now sure Roger was in fact stronger than Whitebeard. I thought their relationship was something akin to Lucci or Katakuri (WB), opponents that were de facto stronger than Luffy (Roger) but got beat/drew due to sheer willpower.
Now I believe it was more like Luffy (Roger) and Law (WB). Roger was indeed stronger than Whitebeard by a decent margin but due to their great relationship Roger held back/didn't tap into overdrive during their clash.
My head canon is that Whitebeard wanted to leave/take down Rocks but couldn't do anything about Xebec, kind of how Law couldn't take down Doffy. In stepped Luffy (Roger) who have "overdrive"-abilities when their comrades are hurt "could turn into a demon" like Garp explained. In other words base Luffy/Roger are equal to WB/Law but have access to another gear when they get mad/need to protect their nakama.
In a way Luffy is lucky to not fight Whitebeard because he was a true monster and if Luffy couldn't tap into overdrive because WB did something horrific to his friends/a population Luffy would not be able to topple WB. But if WB did something to irritate Luffy then Luffy would be able to take WB out. Does that make sense?