For example, if two Marios punch each other at the same time, the attacks will "cling" (that is, both attacks will be stopped) and neither will take damage. This is because the attacks have the same priority; this can also happen if the priority of the two attacks are similar but not completely equal. But if Mario's weak punch were to collide with Yoshi's forward smash, then Yoshi's attack (with its higher priority) will go right through Mario's attack, damaging him without Yoshi taking damage.
If two characters attack each other in the air at the same time, then they can hit each other regardless of priority (unless one of the two attacks comes out faster). Priority only affects grounded characters.
Generally, more damaging attacks have higher priority. For example, a forward smash will almost always trump a jab (except Brawl Captain Falcon's one which despite being powerful it has extremely low priority). The main exception to this is grabbing: a grab always has more priority than an attack (when the attacks "collide", the grabbing character is given a very brief frame of knockback resistance in Brawl).
Generally, having poor priority is a major issue in a character since it makes approaches very hard, and is the main reason why Captain Falcon is low tier. Likewise, having high priority is a major advantage, which is a major reason why characters like Meta Knight and Snake are high tier.