Madara is believed to have been killed by Hashirama’s hand, but he survives and goes into hiding. He awakens the legendary Eye Technique Rinnegan using Hashirama’s DNA. Before dying, Madara takes Obito as his agent and transplants his Rinnegan into Nagato to be preserved for his eventual revival years later.
Hashirama Senju, aka the First Hokage, was the only one who could ever beat Madara Uchiha in life. In death and resurrection, Madara gained access to powers he could never gain in life. However, the First Hokage did famously beat Madara in a duel at the Final Valley and seemingly killed Madara.