Very much to do with the Polyphenols inhibiting or increasing Nitric Oxide Synthase.
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3524723/
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2723458/
https://academic.oup.com/eurheartj/article/24/13/1210/397048
Myself, I cannot drink green tea or eat chocolate because it inhibits NOS1 and I have a genetic sensitivity (NOS1AP) that causes them to trigger mania, anxiety, and insomnia as do many of the phenols in many plant foods.