AI generally refers to 'narrow AI', which describes purpose-built algorithms that can perform specific tasks in a limited field only, such as language translation. In contrast, 'general AI' refers to algorithms that can learn anything humans can, by effectively transferring its capabilities in one field across to other fields (wherever necessary to perform all types of new tasks). Most work in data science concentrates around narrow AI.
Machine learning (ML) is one of the most prevalent methods of achieving 'narrow AI'. It works by effectively giving machines the ability to learn from data and recognise patterns through statistical models in order to make accurate predictions and, where necessary (such as when being deployed in self-driving cars), to determine the best course of action.
In the legal services sector, narrow AI is often deployed to perform tasks in the field of natural language processing (NLP). That is, tasks that involve interpreting and generating human language in both verbal and written forms. Performing these tasks well usually requires machines to recognise and understand grammar, sentence structure and word meaning, which they are often (but not always) trained to do through the use of algorithms and statistical models in ML.