Priority is priority. There are a bunch of rules by which attacks follow for clashing. By the way, there are certain attacks that break rules regarding clashes, etc.
If the difference is greater than 10%, the weaker attack will clash cancel while the stronger attack will continue on.
If the difference is less than 10%, both attacks will clash cancel.
If two attacks collide but no collision boxes (or hurtboxes) are touched, both attacks will clash cancel.
Special attacks (B moves) can clash with special attacks, aerials, and ground attacks.
Ground attacks can clash with special attacks and ground attacks.
Aerials can only clash with special attacks.
Note that there are exceptions to this set of rules.
Non-interactive hitboxes - Will never clash and only interacts with collision boxes. Examples: Lasers, PK Thunder, Sheik's needles, Meta Knight's aerials
Aerial special clashes - Clashes that happen with one or more characters in the air will not cancel the attack of the character(s) in the air. The hitboxes in particular that clashed are negated as far as interaction between the two characters, though. Examples: Mach Tornado
Special-class hitboxes - Certain normal attacks have the same clashing properties as special attacks. Examples: Olimar usmash, Meta Knight dash attack