Imagine you have 100 modules project. You have to change many places to update version of that dependency.
Defining global variable is similar what toml file version catalogues is for. Except it is much easier for automation and tools to parse this file format instead of the gradle files grepping.