couldn't you just assign each student an ID, get a random permutation of the array of students and assign violence to even indices and non-violence to odd? what am I missing here?
You can do that, but it requires all of the assignments to be done simultaneously at the beginning of the study, which will cause problems for e.g. medical trials where not everyone enrolls at once.
But why bother? There's no special statistical value in having two exactly equal buckets as opposed to one bucket with 1,621 people in it and another with 1,427.
If you did want an exactly even split, you could assign every even numbered student randomly and every odd numbered student to the opposite group of the student before them. That guarantees an even split and doesn't require all the participants to be known in advance.
It also guarantees that you split evenly any group of people arriving at similar times, so no correlation between arrival time and outcome will affect the study.