How do the keyword critera work?

How do the keyword critera work?

Hi,
I'm working on automated assignment of tickets based on keywords.
How does this feature work? Where does this criteria look for keywords - email address, subject, email body?
Can you please clarify this as I want to avoid overlapping with criteria such as subject contains or email is/contains.