How do the "Walking Trees" attack?

I know that they can hit you with their branch and to put out flowers that will open and release poisonous gas. What is not clear is when will those flowers open. I've tried to experiment with it. Sometimes they will only open when I walk past them, sometimes they will open just like that. Sometimes they will not open until the tree is dead and sometimes they will open during the fight.

How exactly do those flowers work?

enter image description here


The Walking Tree flowers erupt shortly after you step over them (but not instantly), or after a period of about 5-7 seconds after they are initially spawned.