makes wonder how he gained power with that mindset(historically)
Well, Zhang was a vicious nutbag, but he probably wasn't as much of an asylum case as that story makes him out to be. He caught on because of a general crisis in Ming Chinese state and society: the economy went to pieces, the army started to fall apart, there were crop failures all over the place, and the people at the tip of the bubble - the most marginalized, poor parts of society - got to bear the brunt of it while the richest aristocrats swanned around in Jiangnan writing bad poetry and plotting coups against whichever of the Chongzhen Emperor's favorites was "in" that particular week.
Zhang had army experience, so when he was knocked loose from the military (disciplinary issues and pay problems) he hijacked a group of preexisting peasant "bandits" who needed a good leader. And he was militarily competent - not enough to consistently beat the government's forces, but enough so that he could
sometimes win, and in winning build a reputation as one of the best leaders available to fight the Ming. He was a typical "bandit" leader of his time for much of the 1630s - someone who had some military skill, who was a fairly brutal man leading other brutal men, who kept losing and defecting and rebelling all over again - but things appear to have changed after 1644, when he took control of Sichuan. After Chongqing rebelled against his forces, Zhang is said to have gone off the deep end with rage, massacring people indiscriminately and ordering them to be mutilated. In 1647, the newly installed Qing dynasty's forces invaded Sichuan, annihilated Zhang's forces, and assassinated him during his attempted escape.
Zhang's story gained much in the telling. What he and his men did to Sichuan was an unusually horrible atrocity even by contemporary standards, but contemporaries inflated it even more. The Jesuits, who were relatively newly established in China, chronicled his exploits firsthand and used it as part of a morality tale to contrast the "good" China of learning and (admittedly heathen) culture with the "bad" China of Zhang's crimes. The Ming official history claimed that Zhang's massacres claimed 600 million lives - four times the total population of China at the time. He was undoubtedly responsible for many deaths and mutilations, but not nearly anything like 600 million. And most of the people who died because of Zhang died because of the famines and diseases that spread in the wake of any army in China at the time, not because he ordered them to be put to death.
He makes for great copy, though.