There's a lot of capital floating around out there. Most of it is actually foreign, either OPEC sovereign wealth funds (like how Saudi Arabia put $3.5B into Uber) or wealthy Chinese businessmen. All that capital is seeking a productive return: it has to go do something, if it sits in a bank account it'll just shrink because of inflation. Right now, tech is basically the only sector of the economy that has noticeable growth. Hence, anything vaguely connected to tech gets plenty of funding, regardless of how ill-considered the idea is.
The fundraising climate has tightened fairly significantly since 2015 - that's why all these companies are going out of business. But around 2012-2013, the way you got funded was you went out, painted a picture of how everyone in the world would be using your technology-enabled product, and asked lots of people for money. There were so many people with money to invest that you'd be bound to find somebody.