Is it to allow people to not work at all, or is it to provide an income floor to allow them to bootstrap their way out of poverty into a truly productive, sustainable lifestyle?
A good overview of the concepts is in Manna, a short story by Marshall Brain. It's a quick read and gives an easy description of the economic problems we're in the midst of.
In broad terms, we can imagine an automated factory which is capable of producing all the goods needed by everyone in the country.
Such a factory could get its energy from solar cells, and in addition to making everyone's goods it could make enough solar cells to replenish the ones it has when they go bad, and it could have enough energy to recycle all the waste products from goods that people throw away.
That's a the metaphor of course, but it largely sums up where the labor pool is headed in the next 50 years or so: consumption has an upper bound, automation is making huge sections of the labor force unnecessary, and increases in productivity make the labor we have more effective.
As a data point, note that companies are road testing automated trucks *right now*, companies are testing automated last-mile delivery via drones and rolling robots *right now*, and automated farming is coming on line *right now*.
The trucking thing alone will directly eliminate somewhere between 3 and 5 million jobs, and millions more in support structure: restaurants and hotels on the highway, for instance.
We're at the point *right now* where we have too many capable workers and not enough jobs, and improvements in technology will bring us closer and closer to the "completely automated" factory metaphor used above. The actual factory will be a host of factories distributed around the country, "automated" will still require 100K workers for maintenance and upgrades, and energy will be rooftop solar
...but it's still conceptually one big factory capable of producing everything everyone wants, largely for free.
The regular rules of economics are about to break down. It's currently a sort of cycle, where money flows to the people (through salary), the people purchase things from companies, and the cycle repeats.
With no one working, no one has money to purchase anything so the cycle stops. People starve and the economy halts.
UBI is an attempt at a new economic model. People are given money to spend to keep the economy going, and as a side-benefit people don't starve or commit crimes to survive. Society benefits by having reduced crime and an active economy, and people have more leisure time to do things such as raising children or getting educated.
UBI is one of about 5 proposed solutions for the economic transition we're facing.
It's had a couple of small trials to great success, so it seems like it might be a viable option.