Why?
Because in this kind of forums people usually posts PHP and HTML code to show it (not to be interpreted). If the forum itselfs used HTML code, it would be imposible to just copy&paste the buggy code.
How?
I don't know how they actually do it, but the global idea is to have a list of identifiers to be replaced by codes.
Example:
-> <b>
-> </b>
[a] -> <a>
[/a] -> </a>
I think it was possible to replace an array with another, meaning than array[0] will be replaced by array2[0], array[1] by array2[1]...