Question - When do we use global variables, collection variables, and local variables?
Answer -
Global variables are general purpose variables, ideal for quick results, and prototyping. They are used while passing data to other requests.
Collection variables can be mostly used for storing some constants that do not change during the execution of the collection. They are used for constants that do not change during the execution and also for URLs / authentication credentials if only one environment exists.
Local variables are only available within the request that has set them or when using Newman/Collection runner during the entire execution. They are used whenever you would like to override all other variable scopes.