This concept was visited to a certain extent in the 1950s Sci-Fi movie Forbidden Planet. Where society had finally created a machine that could produce anything in any quantity that was controlled by each beings brain. “Creation by mere thought”. In the story however all beings from this planet were super intelligent. There is no mention of lesser intellect. Check it out if you have never seen the movie. It does drive home the point that in reality nothing in our universe is scarce.
Right. I notice that in the world of Star Trek everybody in the Federation appears to be of above-average intelligence.
You do realize this is all at root a question of what the purpose of human life is? When material needs are provided with little or no effort, it leaves humans face to face with that question. History seems to indicate most do a lousy job of answering it.