It's the main level of the shell script.
FUNCNAME itself seems specific to Bash, and its man page says this:
An array variable containing the names of all shell functions currently in the execution call stack. The element with index 0 is the name of any currently-executing shell function.
The bottom-most element (the one with the highest index) is "main". This variable exists only when a shell function is executing.
Which means it could get confusing too, since e.g. this script:
declare -p FUNCNAME;
declare -a FUNCNAME=(="foo" ="main" ="main")
even though the two
mains are not the same function.
Note that it's not that far-fetched to explicitly create a function called
main. Having a dedicated main function might help with structuring the code, since it's probably easier to read a script where the main program is in one place and not perhaps scattered here and there on the top level between other function definitions.
There's also the idiom of putting everything in functions and calling
main "$@"; exit on the main level to make sure that if the script file is modified during execution, it won't affect the running script. See: How to read the whole shell script before executing it?
I don't know why Bash has chosen to use
main there, instead of something that would stand out more, like the
__main__ that Python uses for a similar use.