Groups and automata: a perfect match