Simplest eg: consider 2 threads both running counter++ on a shared variable.You expect counter to increment twice but it may increment once.
Key factor: the operation is not an (so-called atomic) one-stepper. counter++ is a “load-and-store”. It’s not *atomic*. Between the steps, another thread can change the shared variable.
For a bigger example, consider a web page hit counter.