Boxing and Unboxing:

Boxing: Converting "value type" into "object type" Unboxing: Converting "object type" into "value type"
* The value is copied between stack and heap while boxing and vice versa during unboxing. * Boxing is an implicit conversion and unboxing is an explicit conversion.

Example 1:

A program to understand Boxing and Unboxing in C#.
public partial class BoxUnbox : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Example ex = new Example();
        Object o = ex.boxing(69);
        Response.Write(o); // 69
        int x = ex.unboxing(o);
        Response.Write(x); // 69
    }
}
public class Example
{
    public Object boxing(int x)
    {
        Object o = x; // Boxing / implicit conversion
        return o;
    }
    public int unboxing(Object o)
    {
        int x = (int)o; // Unboxing / explicit conversion
        return x;
    }
}
Note: During compilation of the source codes where ever the value type variables are used, variable names will be replaced by the actual values at that instance of time by the C# compiler. Whereas reference type variables are replaced with the addresses of respective objects. During debugging we can notice the value passed on the value type variables clearly.
[Q] How will you relate casting, boxing and conversion operations?
[A] 1. Data type conversion is done between many compatible data types. Implicit conversion: copy from bigger size type into smaller one. Explicit conversion: between list of compatible data types. (Note: Casting and Boxing are only kinds of data type conversion)
2. Casting is done between base and derived reference types. Downcasting: From Derived class object to Base class object. Upcasting: From Base class object to Derived class object.
3. Boxing is done between value types and object type. Boxing: From value type to object type. Unboxing: From object type to value type. (Note: Casting deals with reference variables whereas boxing is all about only value types & object type)
If object type variable is observed during debugging while casting, boxing and conversion operations are performed, object type variable is able to store any value no matter what is type assigned to it, since all types in C# has object class as its ultimate base class. This kind of nature to accept any type of data is called as Universal type. In C# Object type is the only universal type as it can behave as any type at various situations. (Note: usage of Generics is of the ways to avoid boxing and unboxing.)

Example 2:

Let us look into the scenario where object class reference variable comes in handy to achieve a unique task which includes boxing operation unlike any other type in C#.
public partial class Test : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        AdvAdder ac = new AdvAdder();
        // directly printing "object variable" 
        Response.Write(ac.Add(7,3)); // 10
        Response.Write(ac.Add("Palle", "Technologies")); // PalleTechnologies
        // typical approach using conversion
        int add = (int)(ac.Add(7, 3));
        string concat = (string)(ac.Add("Palle", "Technologies"));
    }
}
public class AdvAdder
{
    public object Add(object o1, object o2)
    {
        if (o1 is int && o2 is int)
        {
            return ((int)o1 + (int)o2);
        }
        else if (o1 is string && o2 is string)
        {
            {
                return (o1 as string + o2 as string);
            }
        }
        else
        { }
        return null;
    }
}
As it is seen from the above example that object type is the input parameter in method Add's signature so that it can get any kind of input. And then conditional statements are used to find our favourable inputs and do actions accordingly. Taking advantage of the fact that "downcasting and boxing never gives exception" comes in handy to use same method input parameter of object type to convert from any reference type and value type respectively.