They're nested, like Russian dolls: artificial intelligence is the broad goal, machine learning is one approach to it, and deep learning is one technique within machine learning. Every deep learning system is machine learning; not every AI system is.
**Artificial intelligence** is the umbrella — any technique that makes a machine do something we'd call intelligent. This includes approaches that involve no learning at all: the chess programs of the 1990s, rule-based expert systems, search algorithms, a thermostat's logic in the loosest sense. If it's hand-coded rules that produce clever behaviour, it's AI but not machine learning.
**Machine learning** is the subset where the system learns patterns from data instead of being explicitly programmed with rules. You don't write 'if the email contains these words, it's spam'; you show it a hundred thousand labelled emails and it derives the rules. This covers decision trees, random forests, support vector machines, linear regression and much more — plenty of ML has nothing to do with neural networks, and for structured/tabular business data, these classical methods often outperform anything fancier.
**Deep learning** is machine learning using neural networks with many layers. 'Deep' just refers to depth — lots of stacked layers. It's the technique behind essentially every recent breakthrough: image recognition, speech, translation, and large language models. Its advantage is that it learns useful features itself from raw data (pixels, audio, text) rather than requiring humans to hand-engineer them. Its cost is enormous data and compute requirements, and being much harder to interpret.
Where generative AI and LLMs fit: inside deep learning. ChatGPT and friends are deep neural networks (transformers) trained on text. So the full nesting is AI → ML → deep learning → transformers → LLMs.
The practical reason this matters: when someone says 'we use AI', it could mean a genuinely sophisticated model or a handful of `if` statements in a trench coat. And if you're learning, the ordering is useful — start with classical machine learning concepts (training data, features, overfitting, validation) because they apply to everything above them, then move to deep learning. People who jump straight to neural networks often lack the evaluation fundamentals and can't tell when their model is quietly broken.