"I like rice."
You might deconstruct the sentence: rice ..liked..is. The somebody who likes the rice, the topic, is left out. So he or she is known or introduced already. This person is the "wa". So rice is subject of the sentence but not the topic. Hence "ga". For an elaborate explanation on wa and ga this site is very good. https://8020japanese.com/wa-vs-ga/