Please let me share my opinion.
I think the particles 「は」and 「が」are close to "a/an" and "the" somewhat. I guess Japanese language teacher has explained it.
「は」and 「が」 emphasize the sentence(phrase) which we want to say. It's like depending on where the important phrase is. Before 「は」「が」or after.
I couldn't explain well, sorry.
Thank you very much.