Humans have a natural aversion to killing, and yes, during war mentioned atrocities do happen, but the soldiers are not perfect killing machines. Often they miss intentionally and just shoot in the general vicinity of the opponent.
See this reddit thread: https://old.reddit.com/r/history/comments/b6k528/percentage_...
Troops can also desert which is especially prevalent in civil war situations. That's why during war, you need propagandists coming up with constant stories about how horrible and bad the other side is, so that you get people to shoot.
The unit that so brutally killed the tianmen protesters was one of the most brutal ones the Chinese military had. That's why they had to wait for days for it to arrive. Had they deployed different units, they might have fraternized with the protesters and joined them in their protest, making the task even harder for the leadership. Try getting even the most brutal unit to shoot at people in their own uniform.
For military parades, you can't afford 5% of people who intentionally don't march in lock step. That's why usually the troops which participate in such parades are isolated and fed propaganda leading up to the parade.
The human component is a constant variable that needs to be accounted for in military leadership.