The two major things that happen when you spill liquid on electronics (specifically I'll be talking about laptops here, but the principles apply to phones, too):
1) Liquid (possibly mixed with dust from inside your device, increasing its conductivity) bridges multiple contact points on the board that shouldn't be bridged, causing a short circuit that (a) causes the device to malfunction (b) causes a component to fail entirely.
2a) Liquid contacts metals, causing oxidation to happen, causing corrosion which eats the metals away. This can cause a component to fail or even fall off the board entirely, given enough time. Once corrosion starts, it will continue, even if you dry a device out with rice/silica gel/any other dessicant. This is particularly bad with liquids like beer.
2b) When a liquid gets into your device and bridges dissimilar metals, it creates a tiny battery, which can cause the oxidation process to start almost instantaneously.
2c) Some components in some devices are coated to help prevent this from happening. For example, the SSDs in MacBooks are coated, so typically getting them wet won't hurt them - unless liquid gets into the contacts where it connects to the logic board. Then you're screwed.
Never put a laptop in rice. It doesn't save the computer, and you end up with a laptop full of rice because it's GOING to get through the fan vents. If you spill something on a laptop, TURN IT OFF IMMEDIATELY, unplug the battery if possible, drain/shake/wipe off as much as you can, and get it to a professional repair shop ASAP. Not the Apple store. They only have one response to a liquid spill and that's "pay us $700+ to replace the logic board".
For phones, your options are somewhat fewer. There are phone repair shops that will open up most models and clean things up, but trustworthy ones are few and far between. Since there are less ingress points in a phone, your chances are often pretty decent of drying it out and making it work again, but don't be surprised if it fails sometime down the road.