CAPE TOWN — He had delivered his last food order for the evening and was driving home from Pinelands, a suburb in Cape Town, when an oncoming car swung in front of him, knocking him off his motorbike.

Friends and family arrived within 20 minutes, but the motorcyclist, Christian Hakomeyimana, was already dead. A 20-year-old Rwandan migrant, he had been a contractor for Mr. D Food, an online food delivery service popular in South Africa.

“That car hit him so hard,” said Xavier Nshimiyamana, one of his closest friends. The bike, he said, was smashed to pieces — “completely beyond repair.”

Mr. Hakomeyimana’s death in the July 5 crash was just one in a rising number of casualties among food delivery workers in South Africa. The emergence here of food delivery apps like Mr. D Food and Uber Eats has drawn thousands of motorbike riders — predominantly migrants — into poorly regulated and highly precarious work.