Why using {{ value | raw }} in Twig and just echo $value in PHP template?

I'm asking it, because I nearly had problem with this - http://stackoverflow.com/questions/20571887/ckeditor-and-code-parsing-strange-change-after-submitting-code

The problem was the string was in raw format and then CKEditor cannot read correct HTML. If I use

<?php echo htmlspecialchars($value) ?> in PHP template

Or 

{{ value }} in Twig template

in files ckeditor_widget.html.php, ckeditor_widget.html.twig

The problem is solved and HTML is valid. This change has no impact on real source code in page, which loads data from entity submitted by ckeditor field. After this change, is my CKEditor working correctly.