It really didn't. If anything putting your electronics in a bag of rice for a long amount of time makes the water evaporate slower and gives more opportunity for corrosion (which is what'll kill your electronics in the end).
Just because the phone worked after one week in rice doesn't mean the rice did anything.
Like I said dry it as quickly as possible (but obviously not with excessive heat) or displace the water by submerging in isopropyl. Getting the water away from the contacts is the goal and rice doesn't achieve that. At all.