Short Definition
A race condition occurs when program behavior depends on unpredictable timing between concurrent operations.
Intuition
Two tasks race to read or write shared state, and the final result changes depending on who gets there first.
Technical Definition
A race condition is a correctness bug caused by unsafely ordered access to shared state or resources in concurrent execution.
Example
Two withdrawals processed at the same time may both read the same account balance and overdraw the account.
Common Misunderstandings
Race conditions can appear even if failures are rare.
Testing may miss races because timing is nondeterministic.