ながら Is Secondary
“You have to learn the rules of the game. And then you have to play better than anyone else.” – Albert Einstein

In ながら grammar, the ながら verb (i.e. たべながら, or whichever verb has the ながら attached to it) is of secondary importance. It is not the main thing you’re doing. So, for example, let’s take a look at this sentence:
a あるきながら はなします。
While (we) walk, (we) will talk.
In this sentence, the thing of importance is the talking. It’s not the walking. Let’s take a look at this conversation:
a Q: ちょっとはなしてもいいですか? (Is it okay if we talk a bit?)
a A1: いいよ。あるきながらはなしましょう。(Sure. While we walk let’s talk)
a A2: いいよ。はなしながらあるきましょう。(Sure, While we talk let’s walk)
These sentences contain grammar you haven’t covered yet, but I bet you can tell me which answer is the grammatically correct one.
If you guessed A1, then you’re correct. Why? Because the secondary action was walking, not talking. The person asking the question in the first place asked if they could talk. So, talking is the primary action, walking is secondary. Since the verb with ながら on it is always the secondary action, you’d want that to be walking, not talking. Therefor A1 is the correct one.
Before you move on, make sure you have it in your head somewhere that the ながら verb is the secondary action. You can think about it this way… The verb with ながら is in stem form. It’s been cut in half by the ながら grammar point. Because of this, it’s not as good as the full verb at the end. That’s why it’s secondary. Hopefully that helps you to remember!
To be honest, it’s not the end of the world if you mix them up, and people will understand you … but it is the difference between sounding fluent and not sounding fluent. Learning little things like this over time will add up until one day you’re suddenly like some kind of Japanese language master.