Pills dissolve in the stomach when they are broken down by stomach acid. According to the Merck Manual, different dosages of drugs dissolve or dissolute inside the stomach based on the properties of their physical, outer shell. For example, tablets that have enteric coatings, such as aspirin, are able to withstand the low pH of the stomach, however, pills that do not have this coating will break down in the same conditions.
The human stomach is generally an acidic environment with pH levels ranking between one and two. Medication that dissolves in pH one or two is processed to make its way into the bloodstream without having to go through the intestines. Not all drugs are meant to be dissolved in the stomach, because the acidic environment can interfere with the drug's potency. If a medication does not dissolve in the stomach, it is usually the job of the juices inside the large intestine to break it down, before it is further metabolized.
The rate and location where a drug is released in the body is important when considering the toxicity of the drug. According to Ansel's Pharmaceutical Dosage Forms and Drug Delivery Systems, a rapid rate of drug absorption is not considered ideal; and, it may promote further health implications, such as eroding the lining of the stomach.