Rules, statistics, neurons
The first systems had hand-written grammar rules and dictionaries. In 2006 Google Translate used statistics from millions of translated texts. In 2016 it switched to neural networks and quality jumped. The Transformer was in fact originally designed for translation.
This website too
The translations of this site into seven languages were made with the help of artificial intelligence. Machines are very good at it today, but for contracts and official documents it is still wise to have the translation checked by a human.