It depends on the meaning of 'easier', I think. In both cases, 'the computer'
can do it, meaning the program `troff` or the program `(la)tex`, and I'm not sure it's reasonable to call one or the other of those programs 'easier' for the computer; but perhaps you are thinking more of something like syntax highlighting?
In that case, I would argue that it's not easy at all with (La)TeX. The obvious difficulty is people mucking about with cat- and char- codes; but, even if that's not happening, you've got things to worry about like old-style `$ $` and `$$ $$` delimiters. I've never seen a highlighter handle `$\text{$math$}$`, or even `\(\text{\(math\)}\)`, correctly.