The sole purpose of this, assuming it is in main.py, is so other files can import main to include classes and functions that are in your "main" program, but without running the source code.
Without this condition, code that is in the global scope will be executed when it is imported by other scripts.