The first time Whitebeard was introduced in the story, he was an old man attended by nurses and attached to medical support.
We immediately get told he is sick, considering Shanks says he brought healing water as a gift to their meeting, but at first we think it’s just his old age making him weak. Whitebeard also wore a huge bandana on his head, but we thought it was just a pirate look.
However in any flashback of his, from his youth up to the most recent chapters where he is in his prime, Whitebeard’s design always emphasized his fluent long blonde hair, as a key trait for the character’s iconography.
The fact he doesn’t have any hair when he is old, with just his bandana on, and it’s the only key trait that changes from his iconography, combined with his sickness and phlebos, means that Whitebeard had cancer. The first time we see him, he is undergoing chemotherapy. The healing water from Shanks was to help Whitebeard’s body to fight against cancer.
So the old man didn’t just go to Marineford to save Ace. He knew he was dying anyway and saw the perfect opportunity to die with one last big fight to get away as the strongest man on earth! That’s why in the end he didn’t care to retreat. His injuries were an excuse for us spectators to think that he would have died by battle.
Probably Marco knew about it, being the medic, but we don’t know if the rest of the crew was informed of how serious it was.
Years before, another incurable illness took away his rival/partner Roger.
Maybe the same illness that will start eating out one of the Yonkos, and made Roger realize he didn’t want to spend his life with chemotherapy (that’s why he didn’t lose his hair). Both of them were bound by the same fate, and in the end, they decided to die as they lived.
Respect to you, Edward Newgate. You fought against Admirals with cancer, giving it all, and you still crashed them.