When I talk to users about this, the one thing that seems to cause the most confusion is the export option Write Keywords as Lightroom Hierarchy. This option is found in the Metadata section of the export dialog.
Here's how all of this fits together. We start with the Write Keywords as Lightroom Hierarchy unchecked. All of the export options are checked. When we export to a new file and check we see these keywords in the file.
To understand how the keyword tag options interact let's turn off the Export Containing Keywords and Export Synonyms options for the keyword blue. Blue's containing keywords are Category 2 and color. Its synonym is azure. With the Write Keywords as Lightroom Hierarchy option off we find this in the exported file.
Wonderful! As expected, blue's containing keywords and synonyms have not been included in the exported file. Now let's turn on the Write Keywords as Lightroom Hierarchy and see what we get in the next export.
Did you get it right? Great! The Lightroom Hierarchy overrides the synonym option since synonyms do not appear in the Keyword List panel. However, containing keywords are impacted if they have not been directly applied. That means that if color is associated with an image ONLY BECAUSE the keyword blue, for which it acts as a containing keyword, has been applied, then the hierarchy option will effect it. However, if both color and blue are actively applied to the image then the hierarchy option will have no effect on it.
The keywords resulting from the interaction of these options are embedded in the resulting files. For example, pulling these images up in Bridge, we can see the same keyword results we have already looked at.
Now that we've come this far down the path I have to apologize. When you start to play with option combinations things can't help but get confusing. So if you find yourself more confused than before then step back. Start simple. If you expected a keyword to wind up in a file but it doesn't, look at the options we've discussed. As you do that things start to clear up. Bookmark this article and the previous keyword article and refer to them. When you understand how the keywords and options interact then you can fit them into your workflow.
As with any other concept... experiment, learn, adjust, experiment again! Most of all, have fun!