1. buy at a discount (essentially a fee for the service of selling your house with a click)
2. sell at a markup (we're talking a small one in most cases, but the fact is in a good market you can reliably print small amounts of money with some paint, some minimal landscaping, and new kitchen appliances. Zillow will not be using a high-interest loan for the purchase or repair, so they will not be sweating like your typical flipper on TV.)
Assume for the sake of argument that Zillow has data to decide where these bets are safest based on comparables and key economic indicators. And they will say no to sellers as often as the data suggests they should.
I don't think this has much to do with finding super-profitable deals with data, but with reliably shaving points off a large pipeline of deals.
If it doesn't work in a healthy economy, they stand to lose the difference between the discounted price they paid for a house and the market value they can sell it for. In a recession, they can probably stay afloat by renting properties they can't sell at a decent price.