He’s Anakin’s confidant, he’s a politician whose home planet is the place that they got married, and he can foresee the future.
I’m all for pointing out plot holes in Star Wars films and books, but that part actually makes sense.
While I agree that the whole point of that scene was to get Anakin to commit to turning to the Dark Side (and was planned by Palpatine specifically for that effect), Windu was nearly 800 years younger than Yoda, four feet taller, and was generally noted as an expert in lightsaber combat. I have no trouble believing that Windu could have won that fight (especially since Palpatine was defeated, in the end, by a one-handed, half-dead, wheezing cyborg).