It is surprising that we do not realize that many foods or plants that we eat have other properties and many of them medicinal. Consider the lowly peppermint plant – It is an hybrid of the water mint and Spearmint. Dried leaves from the plant were found in the Egyptian pyramids and was also valued by Greeks and Romans.
It contains a volatile oil containing menthol and menthone among other flavonoids.
Its primary use is as a antispasmodic thought the oil is strongly antibacterial. The primary use is in helping with digestive ailments. It relieves gas, flatulence, bloating and helps with diarrhea and spastic colon which is sometimes the cause of constipation. Clinical trials in Denmark and UK pointed to a small decrease in Irritable bowel severity but the effect was small. https://pubmed.ncbi.nlm.nih.gov/31470006/. One complication might be their use of small-intestine-release peppermint oil rather than the whole herb.
Another effect is pain relief. Applied to the skin it relieves pain and reduces sensitivity. Usually used for headaches and its effect might be mediated through its ability to irritate.
When eating these herbs, they are primarily eaten these days for their taste and the effect on the palate more than anything else but it is entirely possible that there might be other effects that should also be considered.