Both naturally from rocks and soil, and latent arsenic from decades of arsenic pesticide use. Arsenic pesticides have been banned for a while, but they’re still in the soil.
Rice, for whatever reason, can take up this element more readily than other crops. There has been some research on this: https://pubmed.ncbi.nlm.nih.gov/29749629/