I don't see how they're different then hash functions. Couldn't Alice use Bob's key to produce a MAC and send the message to Jim.
I assume you mean Message Authentication Code.
The major difference between a MAC and a hash function is that the MAC also takes a secret key as input. Therefore the MAC provides both integrity and authenticity for the message.
Example how it is used:
Both Alice and Bob know the secret key k. Alice wants to send an arbitrary long message m.
- She generates a tag. tag <- S(k,m).
- She sends message m together with the tag.
Bob verifies this.
- V(k,m,tag) = Yes/No