The Avengers: Infinity War Thanos is more powerful because he collects the Infinity Stones throughout the film and in Avengers: Endgame Thanos only gets them right at the end. The difference comes in that the Endgame Thanos is a lot more ruthless than the Infinity War one. This is because his motives have changed.
Thanos: I thought by eliminating half of life, the other half would thrive. But you've shown me, that's impossible. And as long as there are those that remember what was, there will always be those that are unable to accept what can be. They will resist.
Tony: Yep. We're all kinds of stubborn.
Thanos: I'm thankful. Because now, I know what I must do. I will shred this universe down to its last atom. And then... With the stones you've collected for me, create a new one. Teeming with life, but knows not what it has lost but only what it has been given. A grateful universe.
Tony: Born out of blood.
Thanos: They'll never know it. Because you won't be alive to tell them.
In Infinity War though he is still trying to only take out half of all life and os isn't using full force or even trying to kill the Avengers because that goes against his whole motto of "rich and poor alike". If he started selectively killing them because they oppose him physically it mashes with what he wants.
Thanos: But at random, dispassionate, fair to rich and poor alike. They called me a madman. And what I predicted came to pass.
Avengers: Infinity War
Note though that Thor hitting Thanos with Stormbreaker isn't because Thanos was less powerful, note he had the full Infinity Gauntlet at that point, but because Thor catches him off guard.
When asked directly if Stormbreaker was more powerful than the Infinity Gauntlet, the Russos responded with the obvious: a glove capable of wiping out half the universe’s population is more powerful than Groot’s arm attached to a sharp piece of magical metal.
“Thanos didn’t know what was coming his way and if he did he would have been able to use the stones to better react to Stormbreaker,” Sciretta paraphrased.
Inverse, The Avengers' Most Powerful Weapon Still Can't Beat Thanos, Russo Bros. Say