One box, two names
int score = 5; makes a variable: a box of memory in main's stack frame, holding 5. The name score is how your code reaches that box.
int& ref = score; makes a reference. The & after the type means no new box: ref is a second name for the box score already names. Both names reach the same memory, at the same address.
ref = 7; writes 7 through the second name. There is only one box, so score is now 7 too. Using a reference always means using the object it names.
A reference must be bound when it is made: int& r; does not compile. It cannot be null, and it can never move to another box. If other is another int, a later ref = other; only copies other's value into score.
Reference parameters
twice(score); calls a function, and a new stack frame for twice appears. Its parameter int& n is a reference, so n binds to score's box. Nothing is copied: this is pass by reference.
n = n * 2; reads 7 through n and writes 14 back through n. That box lives in main's frame, so the function has changed the caller's variable.
twice ends and its frame is removed, and the name n with it. The box and its value stay: score is 14. main returns score, so the program's exit status is 14.
Copy or reference?
Now drop the &: void twice(int n). If line 8 called this version, n would be a copy: 14 goes into a new box in twice's frame. n * 2 changes only the copy, to 28. score stays 14.
Add const: void twice(const int& n). n still names score's box, so nothing is copied, but n is read only. Line 2 writes to n, so it no longer compiles. For big types such as strings, const& skips a costly copy.
What happens
;; step 1/9 · variable line 5 int score = 5; box 0x1c (an int, 4 bytes on common systems) value 5 names score the box lives in main's stack frame
Addresses such as 0x1c are short made-up examples. Real stack addresses are much longer and change from run to run. The C++ standard does not say how a reference is stored: a reference is not an object and need not take any memory. In practice a reference parameter such as int& n is usually passed as the address of the argument, much like a pointer.