One example is a parent server connect API with a variable var1. If you call a child library action as part of that API and inside it also reference a variable named var1, then:
If global is left blank, the child action can do whatever it wants with var1 and the parent’s var1 will remain unaffected.
if global is set and named var1, then that child will automatically update not only its var1, but also the waiting parent’s as the child does its processing.
In a good use case, this equals highly reusable, elegant modularized code. Bad case: it leads to subtle bugs that can be a headache to trace.