Some SPOILERS for Avengers: Infinity War and Avengers: Endgame to follow.
In Avengers: Infinity War, Thanos beats the brakes off of the Hulk in hand-to-hand combat and, with an assist from Peter Quill, defeats the Guardians of the Galaxy and members of the Avengers in the battle on Titan. Yet, towards the end of the film, in a scene from the trailers that at the time seemed to herald his death, Captain America holds back Thanos’ gauntleted hand.
Not to take anything away from Steve Rogers, but no amount of Super Soldier Serum should have made him able to physically withstand Thanos to that degree, especially after the feats we had already seen the Mad Titan pull off. But there is an explanation for how Captain America holds Thanos back in Avengers: Infinity War, as screenwriter Christopher Markus explained:
Steve Rogers is giving his all in that moment, and he has always shown an ability to punch above his weight and ‘do this all day’, but that does not account for what happens in this moment in Infinity War. Instead, holding back Thanos is more the result of Thanos not going all out than Cap being any sort of physical match for him.
As Christopher Markus told The Hollywood Reporter, in that moment, Thanos is impressed by the display of will and courage from Captain America. The fact that a puny human, devoid of any cosmic-level powers would challenge him in such a way catches Thanos off guard and that results in him kind of taking things slowly and pondering Cap for a moment.
You can see this in Josh Brolin’s Thanos performance too. When Cap first holds back Thanos, the Mad Titan appears surprised and curious. He is impressed with Captain America’s strength of will, and given his conversation with Tony Stark on Titan, we know that Thanos appreciates and respects those who put up a good fight against him.
Eventually Thanos gets over being flabbergasted by Cap and tires of him. He then actually exerts some force and easily overpowers Cap before knocking him out. So, as strong as he is, it was never a case of Captain America truly matching Thanos in a game of strength. But just the mere fact that Cap’s will impressed Thanos, he of “the hardest choices require the strongest wills,” says a lot about Steve Rogers.
Cap’s resistance against Thanos is also not an instance of the Infinity Gauntlet in some way sensing Cap is worthy to wield it and tempering its power. The Infinity Gauntlet is not Mjolnir, which evaluates a person and judges them worthy or not. As we saw in Avengers: Endgame, you either can withstand its power or you can’t.