There is no magic at all, just keep it simple as is...
Boxing is the act of converting a value-type instance to a reference type instance.
Unboxing reverses the operation by casting the object(reference type) back to the original value type.
So you have to understand difference between value-type and reference-type and also stack and heap
Value types - build-in types like int, string, char, double and struct - stored in a block of memory called STACK
Reference type - class, delegate, object - stored in a block of memory called HEAP

Now, when you understend the diagram above let's take a look on the real, simple code.
int i = 1;
object O = i; // Box the int
int j = (int)O; // Unbox the int
