Let's see,

 !a[$0]++

first
 
 a[$0]

we look at the value of `a[$0]` (array `a` with whole input line (`$0`) as key).

If it is null (empty) ( `!` is negation in test will eval to true)

 !a[$0]

we print the input line `$0` (default action).

Also, we add one ( `++` ) to `a[$0]`, so next time `!a[$0]` will evaluate to false.

Nice, find!! You should have a look at code golf!