Because encoded characters are HTML, and the Raw version of that string is the encoded one.
Html.Raw renders what it is given without doing any html encoding, so with
ViewBag.div = "<div> Hello </div>";:
<div> Hello </div>
However, when you have encoded characters in there, such as
ViewBag.Something = ">"; the raw version of that is
>. To get back to actual html you need to
Html.Raw(HttpUtility.HtmlDecode(EncodedContent)); as you’ve said.
If Html.Raw did do the decoding then it would be confusing, and we would need something that didn’t do it. 😉