The idea of an unlawful order is pretty new, really dating back only to WWII, although the roots could be said to go back to the Geneva and Hague Conventions of the 19th century.
The idea of precedence is a simpler one, rooted in some of the oldest legal precepts out there.