Static

Typically, in programming, the keyword static means just that, a thing that never changes. If you define a variable as follows:

static int foo = 100;

foo will always be 100 and the compiler will not allow you to change this value in the code. This is also called a Constant in other languages. It is often the case that programmers defined constants as globals which could not be changed such as:

static float pi = 3.14;

This allowed for simple use of these values without having to pass all the arguments.

Locals are usually preferred since they provide more robust code that is less subject to security issues and less likely to cause naming conflicts with other programs. (I write a piece of code with a global named myGlob and you write a piece of code with a global named myGlob. This is fine until we merge the code into the bigger program and then we have problems that may be tricky to fix in a large application.)

In the world of classes, public static declarations allow us to share a field between all objects (the same global idea with different terminology). This means that all the objects in a class can share this value. The same rules apply if it is a large object and typically these are universal constants (like Pi or e or the atomic weight of lead).