The idea is that the vomit has already climbed from the stomach all the way up the throat and has now reached the back of the mouth. Any more provocation and it will simply have to be spewed forth! Of course, it is a figurative expression and does not refer to actual physical sickness. It is, in a sense, just an extension of the older phrase, 'sick to the stomach'. It will probably be impossible to trace the very first use of the phrase.