It's a huge and complex topic, so the best we can do is a brief overview.
The first agricultural societies began about 10,000 BCE, with several independent shifts around the world from relatively nomadic lifestyles to those tending crops.
This is largely an accident of geography; Sulfur deposits are abundant in a stretch between Mosul and Fatha...which allowed easy access.
These were either natural minerals or plants which had been used in medicine.
Sometimes these worked, sometimes they didn't.
Later developments included the use of ash as a repellent/suffocant, sulfur fumigation, and use of oil to keep insects from laying eggs.
Around 300 BCE, the Chinese were using weaver ants to control caterpillars and beetles which attacked Citrus crops!
Grain was often kept in huge pits, and people started developing techniques to reduce moisture and oxygen to prevent insect and fungal growth.
So even back then, we were on top of things.
This method is still used by some cultures today, although methods are more complex.
During the 1700s and the 1800s, there was a rapid change in agriculture from a subsistence lifestyle to a more commercial business enterprise.
In essence, we accidentally domesticated *a lot* of bugs.
If you're familiar with old-timey cartoons, you may recognize this. This is one of the first widely available pesticide sprayers which were used on farms.
DDT was the biggest leap in this era, and it's super important because it was practically non-toxic.
Yes, Carson got some stuff wrong. Yes, banning DDT was somewhat political.
This also popularized the idea of 'least use' approaches to pest management, and the idea that we should treat only when farmers will lose revenue due to losses by pests.
Starting in the 1910s, we start seeing the development of Bacillus thuringiensis as a pest control product. China and Brazil start developing viral pesticides.
It's recognized that these crops can be fairly specific, and we can find and use highly specific proteins.
We also start caring about management of resistance to pcides.
...and that's where pest control's going in the future.
Development may be slowing down. This is somewhat in part to regulation, but also because companies want to make less toxic pesticides.
So they're a bit more choosy nowadays.
It's gone from using local plants and minerals, to a process which screens hundreds of thousands of compounds to find a single product.
It's also going to change in the future, especially with the advent of robotics and AI.