They're paying the cost of people who take Ubers. I mean, when you book a ride and they charge you $12, it's really a $18 ride and they're covering $6 of it. There are costs they pay out, to the drivers, to their staff, to the coders, etc.
But they know if they charge more, people won't take them (or, they'll be the same price as a taxi or lyft or another option).
The more people that ride Uber, the more money they lose.
Amazon operated like this for a while. Instead of having a single "loss leader" product, everything was a loss. Eventually, though, they turned a profit.
Uber is hoping to run the same model. They're hoping that they offer enough low-prices that they will kill off all of their competition, then they can charge $24 for the $12 ride and make $4 of profit instead of $6 in loss and that people will pay it because they're the only game in town.
Risks? That people won't be brand-loyal to Uber and switch to Lyft if the two get into a price war. And, that even if they do kill everyone else and are the only game in town, people won't pay $24 for a ride they usually pay only $12 for and stop using Uber and just get a ride somewhere else or take their own car.