The <div ... </div> is written to stdout; it's a side-effect, not the result of the expression. It is the trailing "</" that's the result of the expression, and therefore gets written to stdout after the expression's side-effects.
I don't think 'tag means to return "</" in particular. It's just that 'pr -- which is used to write the closing tag like so: (pr "</" ...) -- returns its first argument and 'tag returns the value that's returnd by 'pr.