Not totally sure, it's a song from the north-east of England (tho' I'm sure others will lay claim!). It may be that the herbs are used in the verses to ward off the devil, much as in the burden in the "fause Knight on the Road" ballads (such as Whittingham Fair, Scarborough Fair etc)I've sung this since a child to a tune my grandfather sang which tends to be different to that sung in more common parlance.
Graham