These companies generate billions of dollars a year in profit. They, quite literally, have nothing better to do with their money than invest.
Interestingly, this is what will make these companies so entrenched for decades to come - anything that would ever come close to being a competitor..they will be part owners of.
I'm pretty sure they both operate at a loss or at least come very close to breaking even. There is a 0% chance Uber or Lyft make "billions" in _profit_ every year.