The 'volatile' keyword ensures that the value of a variable is read from the main memory and not from a thread's local cache, preventing visibility issues in multi-threaded environments.