By the 1700s AD, the Jesuits owned a lot of farms and mines in countries all over the world. The governments of these countries started to worry that the Jesuits were too powerful. Also, the governments wanted to get their hands on all the money the Jesuits were making. The Enlightenment was making a lot of people think organized religion was bad, and the Jesuits were the most organized part of religion. For all of these reasons, countries began to force the Jesuits to leave.
In 1719, Peter the Great threw the Jesuits out of Russia. In 1754, Portugal made all the Jesuits leave Brazil. In 1763, Louis XV forced them out of France. In 1767, Austria and Sicily banned the Jesuits. In the same year, Charles III made the Jesuits leave Spain and all of Spain's colonies - Mexico, the Philippines, Ecuador, California, Arizona, and many more. In California, and many other places, Franciscan monks came to replace the Jesuits (San Francisco, which got its name in 1769, was named after these Franciscans). In 1773, even the Pope made a rule that ended the Jesuit order completely.
You might think that the Pope's ban would be the end of the Jesuits. But in Protestant countries like Prussia, they didn't care what the Pope said. Jesuits in Prussia (which ruled Poland) kept on running their good schools and helping the poor. In Russia, people were Orthodox Christians and not Catholics, so Catherine the Great told the Jesuits to just keep on going. The Jesuits stayed in China, too.
A generation later, in the early 1800s, organized religion came back into fashion, and most countries let the Jesuits come back. By the 1780s a new Pope allowed the Jesuits to teach in Prussia and Russia, and in 1814 Pope Pius VII allowed Jesuits in Catholic countries too. By 1823 the Jesuits got back all their land and wealth in Spain. In 1832, the Jesuits worked hard to take care of people in the first cholera epidemic in France, and so the French government let them come back to France too.
In 1820 the Jesuits were thrown out of Russia again, and in the 1880s they were thrown out of Spain. So that wasn't the end of all their problems. But in many places Jesuit men continued to run excellent schools for boys throughout the 1800s and 1900s. Girls were not allowed to go to Jesuit schools until recently. Until the 1950s, Jesuit schools couldn't teach biological evolution.