Growing up in Illinois along the Mississippi, I always heard that the cake-walk was done to win a prize, a cake (and hence its name). This was told to me by a self-described "old colored man" who lived down the block from me and who remembered "slave days." He'd moved to Illinois from Missouri in 1868, when he was 18 -- when I knew him in 1954 he was 103 years old and still VERY sharp (although "I can't git around like I used to"). He would take up his cane and try to show us how he used to "cake-walk" while he whistled a tune.
But we were very young then, and while it was interesting and all we didn't pay a lot of attention. Now I can't even remember his name, if I ever knew it. We always called him "Uncle" anyway (as in, "Let's go see Uncle.") His wife had died in the 1930s, and he lost a son in WW2 driving for the Red Ball Express in Europe.