A few of things really:
Captain America was injected with the Super Soldier serum
In Captain America: The First Avenger we see Steve's origin story and how he became Captain America. In it we see Steve is injected with the Super Soldier serum which enhances the man and his morals. It also makes him taller, stronger, more muscle, better reflexes etc. Steve isn't your ordinary man. He's also long lived with really good regeneration.
Steve Rogers: Dr. Erskine said that… the serum wouldn’t just effect my muscles, it would effect my cells. Create a protective system of regeneration and healing. Which means um…I can’t get drunk. Did you know that?
Captain America: The First Avenger
Thanos doesn't actually do that much damage
If you watch the fight scene a bit more closely you'll notice that Thanos doesn't actually do too much damage to Cap. Most of the damage in the scene when he has Mjolnir is actually inflicted upon the shield and he only really winds Cap a few times. He doesn't really inflict much upon him.
Cap is also wielding Mjolnir
In this particular fight with Thanos Cap is wielding Mjolnir which means, per the enchantment placed upon it by Odin, that he gains the power of Thor. This means "Thunder God" but also his strength, regeneration amongst other things.
Odin: Whosoever holds this hammer, if he be worthy, shall possess the power of Thor.
It's also worth noting that your comparison to Tony is faulty. The Infinity Stones are the most powerful objects in the universe. Even the act of touching the Power Stone directly is enough to kill someone as we see in Guardians of the Galaxy. Tony wielded all 6 and snapped with them which caused his death. Even Thanos was very badly hurt both times he used them. There's just no comparison really between the Stones and fighting Thanos; Thanos may be powerful but he's nothing in comparison to the Stones.