when you declare a variable it means using the let keyword. After you declare the variable you can change its value multiple times. let camper = 'David'; throws an error because the variable camper has laready been declared in the line above with let.
When you do catName = “Oliver”; you are just changing the value of the variable, not declaring it again.
first of all you declare camper and second time you re-declare it’s but in the same scope you can’t declare a same variable with the same name two times because the are in the same scope
in the seconde case you declare catName in the globale scope anything declared here is accessible in any function function but the opposite is not possible