Basically, this statement is included in one of her book in subject of reasons, how totalitarianism developed.
This quote is actually misattributed to Rand - in fact, it was written by Leonard Peikoff in 2008 in the introduction to a new edition of We the Living. He wrote:
The basic cause of totalitarianism is two ideas: men’s rejection of reason in favor of faith, and of self-interest in favor of self-sacrifice. If this is a society’s philosophical consensus, it will not be long before an all-powerful Leader rises up to direct the faith and sacrifice that everyone has been extolling. His subjects cannot resist his takeover, neither by exercising their faculty of thought nor their passion for values, because these are the two priceless possessions they have given up. The end result is thought control, starvation, and mass slaughter.
Reason and self-interest are central to the Objectivist philosophy. Objectivism advocates rational egoism - an action can only be 'rational' if the consequences of the action are in line with ones own self-interest. The quote above is perhaps better explained by Peikoff in his book entitled Objectivism: The Philosophy of Ayn Rand:
The concept of "egoism" identifies merely one aspect of an ethical code. It tells us not what acts a man should take, but who should profit from them. Egoism states that each man's primary moral obligation is to achieve his own welfare, well-being, or self-interest (these terms are synonyms here). It states that each man should be "concerned with his own interests"; he should be "selfish" in the sense of being the beneficiary of his own moral actions. Taken by itself, this principle offers no practical guidance. It does not specify values or virtues; it does not define "interests" or "selfinterest"—neither in terms of "life," "power, " "pleasure," nor of anything else. It simply states: whatever man's proper self-interest consists of, that is what each individual should seek to achieve.
The alternative is the view that man's primary moral obligation is to serve some entity other than himself, such as God or society, at the price of subordinating or denying his own welfare. In this view, the essence of morality is unselfishness, which involves some form of self-sacrifice.
The first quote, then, expands on this - if enough people act in a self-sacrificial manner, without regard for their own self-interest; combined with a proclivity to act with faith rather than reason, it is inevitable - according to Peikoff - that a figurehead will arise to take advantage of this; a totalitarian leader. The populace, in its new capacity, will be unable to resist.