Uncooked rice is a desiccant. It may not be very efficient but it works to a degree. For one thing, it is used to keep salt from clumping in salt cellars.
The only reason it works with salt is the direct contact with the salt crystals and the bottled moisture content being very, very low.
It’s of not use for electronic devices and just another dumb Internet myth.