Three lines, and the first one sounds like a riddle that answers itself. "What General has a good army in himself, has a good army." The general who has a good army inside himself has a good army, and that circular answer is the point. The sentence closes back on itself the way the self it describes is meant to: complete, needing nothing from outside. Even the title, which simply repeats the opening words, makes the poem begin twice, as if the idea is being set down firmly before anything is built on it.
The central claim is that happiness is something you accomplish, not something delivered to you. The military metaphor makes this surprising. An army is about as external as a thing can be: numbers, ranks, borrowed strength, men taking orders. Whitman moves the whole apparatus inside one person. Judging by the imagery, your own energies, appetites and courage become the troops, and you are their commander. A general with no army of his own has to lean on hired allies, and a person with no inner resources has to lean on other people for cheer. The poem never spells this out. It trusts the image to do the work.
The second line bends its grammar slightly. "He happy in himself, or she happy in herself, is happy." The phrase "He happy in himself" hangs without a verb, like a figure on display, and the verb "is happy" arrives only after the "he" and "she" have both been named. The line is built almost entirely from self-reference. "Happy" appears three times and "himself" and "herself" once each, so the sound of the line keeps turning back on its subject. The "she" also matters. The first line's general is a "he," as military language usually assumes, but the second line widens at once, giving women the same command. It reads less like an afterthought than a correction made in passing.
The third line changes the voice. "But I tell you" is direct and a little preacherly, the speaker stepping forward to address the reader. The poem has no rhyme and no regular meter, which suits a poet so closely tied to free verse, and its lines grow longer as it goes. The first two are balanced and calm, but the third runs so long that, on the page, "by others" spills onto an indented line of its own. The argument seems to gather weight as it moves.
The final comparison is the boldest. You cannot be happy "by others," Whitman says, "any more than you can beget or conceive a child by others." The preposition matters. He does not say "with" or "through" but "by," meaning by proxy, as though happiness were a task you might hire someone to carry out. Then comes the blunt, bodily image. "Beget" and "conceive" are the father's act and the mother's, so they echo the "he" and "she" of the line before, and the comparison is as inclusive as the claim. It is also a little startling in a poem about contentment. Making a child is the least delegable act there is, and by choosing it, Whitman suggests that happiness has to be made from within and cannot be commissioned. The repeated "by others" at the close of the poem lands like a door shutting.
Someone who knows Whitman as a poet of crowds and comradeship might wonder whether this contradicts him. It need not. The poem says that others cannot do your happiness for you, not that they are unwelcome. On this reading, other people can be companions but never substitutes, and the word "by" leaves plenty of room for being happy *with* them.
What makes the poem memorable is how much it fits into so little space. It is an aphorism with a vivid picture at each end, an army at the start and a child at the finish, and between them a repeated "himself" and "herself" that keeps the reader looking inward. It gives no advice and offers no comfort, only a plain statement that the work of being happy belongs to you.