caller-saved versus callee-saved registers
Two people share one whiteboard. If you write a number on it and then ask your colleague to do a quick task, will your number still be there when they return? Only if you both agreed in advance who is allowed to erase what. Registers are that shared whiteboard between a calling function and the function it calls, and caller-saved versus callee-saved is exactly that agreement about who must preserve which register across a call.
A callee-saved register (also called non-volatile or preserved) is one the called function promises to leave unchanged: if it wants to use that register, it must save the old value first and restore it before returning. So the caller can keep a value in a callee-saved register, make a call, and trust the value survives. A caller-saved register (also called volatile or scratch) is the opposite: the called function is free to clobber it. If the caller has a live value in a caller-saved register and needs it after the call, the caller must save it (typically push it to the stack) before calling and restore it after. On x86-64 System V, rbx, rbp, and r12 through r15 are callee-saved; rax, rcx, rdx, rsi, rdi, and r8 through r11 are caller-saved.
This split is the calling convention's answer to a real tension: saving every register on every call would be wasteful, but saving none would mean a value could never survive a call. The division lets each side save only what it must. Reading disassembly, the pushes of rbx or r12 at a function's start and their pops at the end are this rule in action — the function borrowing a callee-saved register and dutifully restoring it. Getting the responsibility backwards is a subtle bug that hand-written or miscompiled assembly can introduce, silently corrupting a value the caller assumed was safe.
Need a value to survive a call? Keep it in a callee-saved register like rbx — but then your function must push rbx in its prologue and pop it in its epilogue, honouring the promise to whoever called you.
Callee-saved registers survive a call (the callee preserves them); caller-saved ones may be clobbered.
Which register is in which group is fixed by the convention, not chosen by you, and it differs across ABIs — the same register can be caller-saved on one platform and callee-saved on another. 'Caller-saved' means the caller is responsible for saving it if needed, not that anyone saves it automatically.