As everybody knows, Zero is the good-hearted but a bit slow country boy in Beetle Bailey's outfit. Here he is, early in the morning, not-quite-awake yet and thinking he's got to go out to milk the cows.
Now, you could make this a joke about Zero being so stupid that he actually believes that he's got to go out and milk the cows, but that wouldn't be particularly funny. First of all, it would be a cruel sort of humor that Mort Walker doesn't resort to, and second, it wouldn't work anyway as that would go against the character of Zero as it has been established in the strip for well over half a century.
So how does Walker go about making this a credible, not-cruel gag? He emphasizes that Zero is still not quite awake, and that that's why he's preparing to go out and milk the cows as he always does at home.
First, the setting tells us about it being so early in the morning as to be practically night. Beetle is in his bed and undressed, which signals sleeping time (of course it's necessary for Beetle to be in his bed and out of his clothes, as Beetle sleeping isn't in itself much of a signal that it's nighttime). Note also Zero's state of undress. He's taking his jacket on outside his undershirt; clearly he's just gotten out of bed.
Beetle's line in the second panel also helps set the stage, by reminding (or informing) the reader that Zero's from a farm, which explains why he suddenly feels so duty-bound to milk cows.
And finally, the clue that tells the reader that Zero's groggy with sleep: Look at his eyes, in both panels. They're half-closed, and not exactly focused; in fact, the don't even line up properly. (Also, the little bubble-like round things behind his head in the first panel is a classic comics marker that somebody is groggy, tired, drunk or a little bit crazy.)
You may think that the gag isn't all that strong, but the backing it gets from the meticulous storytelling nevertheless makes it work.