But the topic marker does not mark the subject. Any sentence with a topic can remove the topic, and the sentence is still a fully valid grammatical sentence.
For more about this, check out Cure Dolly's excellent videos about the zero-が on Youtube.
Edit: Various typos
You're entirely right, what I said there was incorrect (or sloppy at best.) Thank you for the correction.
> That's why it's called a zero-が if there's no "が", because every valid Japanese sentence needs a subject.
This is the part which I find unhelpful. You could say "every valid English sentence needs a subject and a verb", and you'd be having a hard time finding a sentence in e.g. the U.S. constitution that doesn't explicitly contain a subject and a verb.
But in Japanese, not every sentence needs to specify the subject. Every sentence still has a subject, because the definition of a sentence is "a subject and a predicate", but that applies to every human language.
The problem then is that the "zero-が" then feels like bolting a potentially ungrammatical (or at the very least unnatural) construct onto every sentence to explain the simple fact that yes, indeed, Japanese sentences do have a subject, but it's often unspecified. It also misses the important point that が, by clarifying the subject, also has the role of emphasizing it, which changes the meaning of the sentence.
To go on a bit of a tangent, Hungarian has a similar problem. It also frequently omits the subject, and specifying it also changes the meaning of the sentence:
* Lefekszem. =I'm going to sleep. (The subject is already specified by the conjugation.)
* Én lefekszem. =It's specifically me, who is going to sleep. (For example, you are asked if you're going to the after-party, but in contrast to others, you're tired and want to sleep.)
You could add an "implicit én" to the first sentence, to show that yes, it indeed does have a subject. Maybe it's helpful for people whose native language can't just omit the subject. But it subtly changes the meaning, so ultimately I don't think it's very good analysis, but rather "translating into your native language."
As I said, I'm not an expert, but I hope what I'm saying makes sense.
https://en.wikipedia.org/wiki/Zero_(linguistics)
Perhaps the easiest example in English is the imperative form.
"Turn off the light."
"Close the door."
"Please speak louder."
These all have an implicit noun of 'you' which isn't said. Adding it in even sounds wrong.
"You turn off the light."
Instead we would modify it with a different form. "Could you turn off the light?" or "You must turn off the light."
If you translate it that way, 「私は牛肉を食べます」means, in English: "As for me, I will eat beef."
Notice now that both "me" and "I" are present in the translation. So adding が doesn't in fact change the sentence at all!
(It's also strange because I typoed 牛肉 in my earlier comment, and milk is difficult to eat. Sorry for the confusion.)