This is a good--and very loaded--question!
There are quite a few different ways to look at the topic you're raising. Let's start with an easy way.
1. CASE: All languages have "case." If you're unfamiliar with this concept, "case" refers to the role of a noun in a sentence. Common cases include nominal case (subject), accusative case (object), dative case (destination), and genitive case (possession).
Different languages handle case differently. For example, in Russian, you just change the way you say the noun to show what case it's in. So sabaka means "the dog" [SUBJECT] but sabaku means "the dog" [OBJECT], etc.
English only changes words to show case in its personal pronouns. So "I" for subject, "me" for object, "my" for possession, etc. For almost everything else, English just uses other words, or word order, to show case.
"The dog loves cheese" <--Obviously "the dog" is the subject, and therefore in nominal case, because it comes before the verb. Similarly, "cheese" has to be in the accusative case, because it is the object, because it is coming after the verb.
"The dog's toy" <--"The dog" is in genitive case to show possession of "toy". Genitive case in English is typically shown by attaching "'s" or the word "of" to a noun.
In a nutshell, English mainly uses word order to show case, but sometimes modifies words with things like ['s] to show case. Unlike English, Japanese shows case for all words by using particles. If a noun is followed by が
, it's nominative case. If it's followed by を, it's accusative case. If it's followed by の, it's very likely genitive case, etc.
In this sense, there's not a great one-to-one relationship of Japanese particles to English counterparts. While Japanese and English (and all other languages) have a robust relationship with case, they show it in different ways. So while English and Japanese both have the same concept, it looks different.
2. I find this unfortunate, but if you study English or Japanese, you'll be told that there's one は and one が, just like in English you'll be told that there's one "the" and one "a". This is extremely not true! In English, there are three "a"s and three "the"s. In Japanese, there are two はs and three がs.
For English, consider this:
A dog is an animal.
This is two of the three a's. The first "a", in "a dog," shows that I'm introducing new information. In this sentence, "A dog" can be swapped out with "A thing called a dog" because I'm introducing it like you've never heard of it before.
Then, "an animal" uses a different "a": This is the "a" that just means "one". You use this "a" all the time when ordering food: "I'll have an apple," "I'd like a steak," etc. You're very clearly just ordering one thing when you sy "a" in these usages. You're not introducing new information like the listener has never heard of something called "apple" or "steak" before.
Putting that all together, another way of saying "A dog is an animal" is this:
There exists this thing called a dog, and it is one kind of animal.
If you think about it, it's remarkable that English can convey such complex information in such a simple, economical way: "A dog is an animal."
3. Moving on to Japanese. You are very correct to relate は and が to "the" and "a" in English, respectively, but there's a lot more going on here. Here's a brief crash course of は and が
1. Topic Marker 私は学生です <--anything marked by topic-は is the topic of the sentence. So anything said after は will relate to the topic.
2. Compare/Contrast （私は）果物は好きだけど野菜は嫌いです <--は here is used to contrast two different things, namely fruits and vegetables. Not that this sentence is NOT topicalizing either 果物 or 野菜
There are more complex ways to use the Compare/Contrast は, but this gives you the basic gist. For Topic Marker は, however, it's extremely important to note that you can ONLY topicalize things that BOTH the listener and speaker have some familiarity with. This distinction is important, because this is how は can mean something similar to "the" in English sometimes. Compare:
The cat came into the room <--"The cat" means both you and I know the cat. Perhaps it is our pet. In Japanese, this would be 猫は部屋に入ってきました
A cat came into the room <--"A cat" means *I* experienced this cat today, but you did not. Since you do not know this cat, and I am introducing it into the conversation for the first time, I would have to use "a". In Japanese, this would be 猫が部屋に入ってきました
Note, however, that for BOTH Japanese and English, once new information is introduced into the conversation with a/が, it immediately becomes common information to both the listener and speaker. Once that happens, this formerly new information is only referred to with the/は. Consider the following dialogues:
A: A cat came into the room!
B: Weird! I wonder where the cat is from? <--this sounds a lot more natural than the next dialogue
A: A cat came into the room!
B: Weird! I wonder where a cat is from??*** <--this sounds bizarre and clearly incorrect
In this sense, は and が function like "the" and "a" in English: a/が introduce new information into a conversation, and the/は refer to information jointly known between the speaker and listener.
You can expand on this point a LOT more, but this is a good introduction and I think it gives an adequate foundation to the answer to your question.
Lastly, to be thorough, here are the three がs:
1. Simple Subject チーズは犬が食べました <--This just shows the subject of a sentence. If there's a noun doing something in a sentence, and the noun isn't a topic, it's probably just as simple subject. Use が to mark simple subjects when you don't plan to talk more about something.
2. Temporary Status あ！空が赤い！ <--This が shows temporary status. It's comparable to soy/estoy in Spanish. If a state of being is likely to change, or is certainly not permanent, you'd most likely mark the subject with が and not は (for example, if you said 空は赤い, this sounds like the sky is normally red, so it'd therefore sound like maybe we were having a conversation on Mars, but certainly not Earth)
3. Exhaustive Listing 私が学生 (English translation: I am the one who is a student) <--This is the trickiest and least common usage of が. Basically, it means "Nothing else but the thing marked by が is X." In English, we use a grammatical process called "clefting" to convey a similar meaning. Consider these example sentences:
彼が食べた He's the one who ate
由紀子がヒトラーを殺した Yukiko is the one who killed Hitler
淳介が先生 Junsuke is the one who's a teacher
Basically, if you see a sentence where は or が could be used, and you use が instead, it's most likely going to be the exhaustive listing が.
I hope this helps!