If you watched the movie it did go into some of the origin,
like what is seen in this picture, but what if the world's future as we see there is not so far fetched? From now to then, here is how I think it went, and could, go down.
The world now is heavily populated and its definitely had an effect on the environment. Pollution and trash can be seen in cities everywhere. With the growing population that means more products will be needed. More products means more pollution,(when making them), More burning of Fossil fuels and nonrenewable resources and when the product is finished and used it will result in more trash. Pollution, trash, and the burning of fossil fuels and nonrenewable resources probably all played a part in making the world portrayed in the film, and those are all issues we face today.
If the growing population triggers those things, and we definitely have a growing population today, then wouldn't a future like this seem plausible? As the population grew, so did these issues.The trash built up, the pollution levels rose, and the non-renewable resources came to a trembling low. The damage had been done, and plants and animals started another one of history's mass extinctions. They didn't know what to do.
And then BNL or the Buy N' Large company sponsored the idea of moving to space, in giant spaceships capable of harbouring and caring for millions of people. The government, backed by millions of people in tax money, made ten of these ships, including a mothership. After only one year, they were ready for launch. But there was one problem, they couldn't live up there forever.
Scientists came up with Project Wall-E. They would send millions of robots around the earth to compact the trash and clean up the earth. A ten year project, or so they thought..
In the movie they had been up there for 700 years. They live off of 'Meal in a cup' or a full meal compacted into a beverage, so that would explain how they managed to survive. But they never gave up hope, and sent out EVEs, or Extra-terrestrial Vegetation Evaluators to search for vegetation. The robots on the ship may have prevented past findings of plants but they couldn't be sure.
The WALL-E's couldn't protect themselves from the dangers and natural disasters of earth and were all destroyed. Accept for one, who saw all the other WALL-E' get destroyed and learned. He was lonely and stayed there cleaning by himself for the last 100 years since the only other WALL-E's besides him were destroyed, with nothing but an old movie, a cockroach, and his home full of little treasures WALL-E had found and spare parts taken from those who had fallen before him...