If expert systems are a bunch of If, then, else statements then how are they termed as AI?
TL;DR: What makes AI is not if-then statements, but rather the automated reasoning that went into selecting those particular if-then statements.
You're focusing on the structure of the output rather than how the output was produced. Having if-then control flow statements is not sufficient to make a program &quot;AI&quot;. AI aims to enable machines to solve problems which currently people are better at. Machine learning, a subset of AI, extracts useful patterns from data. A commonly cited example of expert systems is diagnostic medicine.
This begs a lot of questions like, &quot;What does 'useful' mean?&quot; If the problem we were addressing was finding cancer in medical images, &quot;useful&quot; might mean, &quot;able to accurately identify cancer in images at or above the rate of a skilled human examiner.&quot; There's also questions about the amount of data needed, the quality of the data, etc. These are outside the scope of your question.
There are various AI/ML systems that produce models consisting of if-then states. Decision trees like C4.5 build a hierarchy of if-thens (and random forests combine many decision trees). Learning classifier systems (both Michigan and Pittsburgh varieties) come out of genetic algorithms and form similar collections of logic.