(tl;dr: Jump to the actual moving)
Scope is an important concept in programming. It allows you to just write small sections of code to do what you need them to do without having to worry about something else in your code using the same name and messing everything up. Declarations (such as of variables or functions) will only be visible to code also in the same scope, usually some block of code.
MDN has a good example of the effects of scope in Javascript:
let x = 1;
if (x === 1) {...