Wade Wilson was a mercenary diagnosed with aggressive, terminal cancer. Desperate, he volunteered for Department K (Canada's answer to Weapon X), a covert government program attempting to replicate the Super-Soldier Serum / Wolverine's mutation.
Scientists implanted a modified version of Wolverine's healing factor into Wade. The process was excruciating, disfiguring, and nearly killed him—but it worked. The healing factor bonded with his cancerous cells, creating a terrifying equilibrium: his cancer and his regeneration are locked in perpetual war. This is why his skin is scarred—his body constantly heals tumors as fast as they form.
Deadpool's powers are a double-edged sword. He cannot die, but he cannot heal his mind or his appearance. He's trapped in a body that regenerates cancer every second, a mind that fractures, and a narrative he can see but not control. That tragedy fuels the comedy.