The Miseducation of Lisa Simpson is the twelfth episode of Season 31.
The Sea Captain finds a treasure he's been searching for all his life, but it's taken from him by the townspeople. Marge convinces the people of Springfield to build a S.T.E.M. school with the money.
The episode starts off with a flashback in a bar during the wintertime where a German police officer demands that the young Horatio McCallister and his wife hand over the second half of the map in his possession. However, the couple instead spit into a candle, blinding his fellow guards and setting fire to the bar. Escaping with both halves of the map, the couple than begin their journey to Springfield in order to search for the treasure.
The episode then cuts forty years into the future, where the Sea Captain has a now destroyed marriage over looking for the treasure, he finally finds the treasure, but it is confiscate by saying it now belongs to the town now as it was found inside the city limits of Springfield, which have been redrawn after being warned the previous night by his frustrated wife. Not sure of what do with the money, Marge makes a suggest that build a STEM to teach their children about science, technology, engineering, and math to succeed in the future. The townspeople are not immediately onboard, but are once John Legend and his wife Chrissy Teigen's help, they are encouraged to agree to the idea.
At the newly built STEM school , which is run by CEO Zane Furlong, Bart enjoys his new video game-infused education, which allows him to collect badges and skins for his profile, while Lisa is accepted into a gifted class which teaches her about science, coding, math and neural networks. She even learns that school is ran by an algorithm which determines the best education for the students. At a career day meeting at school, Homer talks about his job as nuclear safety inspector at the power plant. However, Furlong disparages as on of the jobs that will be taken over by machine in the next few months. At the plant, his fears are seemingly confirmed when he sees a automated soda machine which efficiently mixes drinks and flavors is installed in the break room. Homer seeking to prove that human are better than machines, begins to engage in with a soda machine, frequently mixing drinks for hours for co-workers until he collapses on the ground in exhaustion and drinking too much soda. Recovering from the fall, Homer feels relief his job as safety inspector will not be taken by robots for the moment, completely unaware that his boss Mr. Burns has already started a trial run for automated machines in the workplace.
Meanwhile, Lisa discovers that children who are not in her gifted class are only being trained to work menial jobs in the present day such as Uber and Lyft drivers. She tries to warn other children, but tells them to embrace their education and career prospects. Frustrated that the students will not listen to her Lisa attempts to rewrite the algorithm in order to determine the jobs of the future, but Bart prevents her from doing so. The siblings start fighting but Furlong stops the fighting and searches the for future jobs on the algorithm himself. However, the three find only job available which only includes looking after senior citizens (with STEM actually standing for Sponge-bathing Toileting Elderly Massage). Bart and Lisa warn the children through a video PA system and students proceed to negatively rate the algorithm, causing an explosion destroying the school. As Bart and Lisa mope over their worthless future, Homer confronts Marge telling her that she will find another way to provide education for the town.
In a tag scene, Furlong, now employed as a food delivery driver, visiting the Simpsons to deliver hot wings and celery sticks for Homer. Bart and Lisa question him about the future what the future will be like now that the STEM school has been destroyed, he answers that technology is changing and could bring about positive prospects. However, a flashfoward shows that sentient soda machines have taken over the planet, forcing residents like adult Bart and Lisa to work as slave bartenders for them while others such as Carl fly around in space luxury cruises.