Can someone explain to me how this works - C#