Semantic highlighting is generally done in another thread so that it can benefit from the parsing/compilation work being done without blocking the user's next key presses while it does all that.
When it is done, it has to trigger a redraw of the document regions that were affected.
The java editor works very hard to maintain the presence of existing semantic highlights in the presence of edits, shifting them around as you edit rather than recalculating them from the AST.