Per Merriam-Webster, the word warning has these meanings:
1 : the act of warning : the state of being warned · he had warning of his illness
2 : something that warns or serves to warn; especially : a notice or bulletin that alerts the public to an imminent hazard (such as a tornado, thunderstorm, or flood)
Meanwhile, the word caution has these meanings:
1 : WARNING, ADMONISHMENT · Her comments were intended as a caution to us to protect our property.
2 : PRECAUTION · a surgeon taking the caution of sterilizing his instruments
3 : prudent forethought to minimize risk · Use caution when operating a chain saw.
4 : one that astonishes or commands attention · some shoes you see … these days are a caution —Esquire
As you can see, one sense of warning is the same as caution, but not all senses. In other words, they are only synonymous in specific uses.
For example, the use of caution by British police as mentioned in another answer would be used in the fourth sense of the definition (or possibly the third, depending on how I look at it)—not the first sense that is synonymous with warning.
When I use the two words, aside from the specific senses per the dictionary definition, I treat them as a matter of degree.
I think of a caution as related to something important but not urgent, whereas I think of a warning as something related to a more severe and immediate threat or danger.
I was cautioned to not restart my computer while it was in the middle of an update.
Use caution when crossing the street.
She was cautioned to tell the truth in court.
I warned her about the muggings in the park.
I warned them to leave town because of the impending hurricane.
Cigarettes come with a health warning.
And in different contexts the other word would be used:
I was warned to not turn on my computer because of the bomb attached to it.
We ware warned to not cross the street until the gas leak was fixed.
They cautioned me to leave town because of the impending media event.
You were cautioned to not smoke in a smoke-free zone.
Also, while I'm used to the expression a word of warning, I've never heard heard the expression a word of caution. So, the different words are used in different expressions and have different associations.