a is a type variable. Think of it as a placeholder that can be substituted by any other type. However, all occurences of a in one type signature must be substituted with the same concrete type.
So if map has this signature...
(a -> msg) -> Cmd a -> Cmd msg
...this would be a valid substitution:
(Bool -> MyMessage) -> Cmd Bool -> Cmd MyMessage
(msg is another type variable)
...while this would be an incorrect substitution:
(Bool -> MyMessage) -> Cmd MyMessage -> Cmd Bool -- note the mismatched type variables
Having type variables gives a lot of flexibility, because a generic function like map can be reused with all kinds of different types.