In some languages, a function can be defined multiple times with different signatures (multiple 'heads'). It will try each clause until it finds one that matches, allowing you to filter or change course on the basis of the value or characteristics of the arguments.
This allows you to easily create special logic for corner cases and is generally extremely useful.
If you look at the Wikipedia article for Greatest Common Divisor, you see this:
gcd(a, 0) = a
gcd(a, b) = gcd(b, a mod b)
That, in effect, is what pattern matching + function heads gives you. You can copy that function directly into ML or Erlang, modulo a couple tiny bits of syntax.
Pattern matching for function heads is magical. Thus sayeth the Erlang fanboi.