I hope, you're familiar with parameter scopes, i.e. local and global variables. Global variables are visible in all contexts including subshells, functions and what not. Local variables are only visible in the current scope (e.g. a function).
Have you ever wondered why ZSH provides so many features but is still so fast? That's because of its autoloading mechanism. Functions can be marked as empty so they aren't loaded before they are executed the first time. This saves a lot of memory and much processing power.