What are the differences between herbicides and pesticides is a good question. A better question would be what are herbicides and pesticides, and are all pesticides herbicides. The answer to that last question would be no. This is because all herbicides are pesticide, but not all pesticides are herbicides. The simple answer is that herbicides are a subset of the larger grouping of pesticides. Maybe it needs clarity.
Herbicides kill plants, and many plants cause problems. It is like crabgrass in the lawn or yellow dodder strangling your tree. You can physically remove them, but if it is a big yard or a large tree you might be several days, and by the time you get to one side the weeds have started reproducing and taking back over the other. It is constant war for control of your property. One of the weapons developed to help the land owner win the war is herbicides!
The Herbicide kills the unwanted plants and can work in several ways. Broad-spectrum herbicides may attack cellulose, which is specific to all plants. It breaks down the cellulose into constituent components and all the cell walls collapse, destroying the plant. These are generally used to keep weeds out of the sidewalk or from the base of buildings.
Then there are broad-leaf herbicides that break down member of the dicotyledon group of plants. These can work through several different mechanisms and some can be very specific. They come in a variety of forms and are used to keep broad-leaf plants out of the lawn or sometimes sprayed around gardens to kill the "undesirables".
Herbicides for monocotyledons work the opposite of those for dicotyledons, it kills the grasses. Again, the effect specific pathways that are only used by monocotyledons. These are mainly used in flower beds to stop the grass form crowding out the ornamental plants or utilizing up all the nutrients.
What are pesticides? They are compounds that kill and remove pests, and they can be a lot of things. Herbicides are pesticides as they kill and remove unwanted plant pests. Insecticides are also pesticides as many insects are considered pests! Arachnicides kill unwanted spiders, and then there are rodentcides for removing rodents, mice and rats. These are all pesticides.
As stated previously, herbicides are a subset of pesticides! Now the statement should make sense.