In the past, automation taking over jobs led to new avenues of employment (and, of course, people utilized the new technology in order to produce fewer children). I'm unsure why automation in the future should be different.
Why would it be different? Because of the scale and range of jobs that will be affected, and the limited room for new, labour intensive industries to rise up. New jobs will appear of course, it is certainly not a given that they will appear in equal numbers though.
Major historical employment changes:
agriculture - production - service
New, labour intensive, industries took up the slack. Tech companies are not labour intensive and can't take up the slack. A company like Amazon could have automated warehousing and delivery in the not too distant future, and will be the worlds largest retailer with a few hundred staff who will be making probably millions of people unemployed worldwide.
There probably isn't massive growth in service industries, which would be needed to simply 'break even' with job losses from AI.
Where do you see the new jobs coming from?
They won't have human emotions and the inbuilt biases and irrationalities that we evolved with.
If humans create a machine too complex for us or the machine to predict the output given an input, perhaps we could build another machine to analyze the first machine.
Perhaps, perhaps not. Depends on the technology and this hasn't been invented yet.