Butterfly vs. Dragonfly

My guess (no concrete evidence for this) is that maybe they are males patrolling their territories for any passing females? So anything that gets in their way of possible success (another male of the same species, other butterflies, maybe even other insects) will be subsequently chased away? I believe butterflies have acute eyesight and so are able to spot the difference between potential mate vs “enemy”.

I have related anecdotal “evidence”, only except the one being chased was me. I was once in a place where a few hilltopping butterflies were, and a good few times when I am in their space, they would “divebomb” towards me, as if in attempt to chase me away.