It is used, in two situations that are almost opposites.
The most common usage is when you expect something a little negative is about to happen, like when you hear someone has said something that another person may not like and there is going to be an argument.
It is also used when the expectation is for something serious to happen, like "I sense trouble between Russia and Ukraine" but you're not sure if what specifically is going to happen.
In either case, it means says to ,"Watch out!"