AI is the fact to progam the computer not explicitly, but implicitly. To reach a wider goal: having program that can adapt to any situation, ideally even those not foreseen by the programmer.
Other have mentioned machine learning. That is just one tool of AI, one tool to do that (implicit programming). The most famous one. But not the most important, and moreover, not the best to illustrate what AI is.
IMHO the best way to apprehend what is AI goals and fundamentals is given by Nils Nisson's cube world.
Nils Nilsson (almost the real founder of the discipline. Turing is often mentioned because of the "test", but Nilsson is the one who gave the first idea about how to go there), imagines a robot, trying to stack cubes in a given order.
There are cubes on a table. Some are stacked onto others. Each of them are labelled with letters. The idea is to move cubes so that they are in the correct order.
For example, if you have this situation:
And you want to have
You can program your robot to do the following operations:
put A on the table
put C on the table
put B on C
put A on B
But such a program is explicit. And would work only if the situation is the one described.
For example, it would not work if the initial situation is:
So, Nilsson's solution is instead of simply using procedures (grab, put), to describe what those procedure can do, and under which condition they can be used. And let the computer compute the correct sequence of procedures to apply.
precondition: X must be on the top of its stack onto a cube Y. And robot hand must be empty
postcondition (effect): X is in robot hand, and Y is now on the top of its stack.
precondition: X is alone on its stack (on the table). And the robot hand must be empty
postcondition: X is in robot hand, and the stack no longer exist
Put X on Y:
precodition: X must be in robot hand. Y must be on the top of its stack
postcondition: robot hand is empty. X is on the top of its stack, on Y.
Using this, the computer is able to compute, from the initial situation, and from the wanted situation, the correct sequence of operations itself.
You use such program very often, if you are a coder: a Makefile is nothing but that. A description of what you can do, when you can do it, and what is the effect. Each rule of a Makefile is
That is what AI really is: method to let the computer decide by itself what is the correct courses of action to do to achieve a given goal.
So that you program yhe algorithm not explicitly (giving a sequence of action) but implicitly (giving a description of each action effect, and giving an objective, so that the computer figure out itself what to do.
Machine learning is only one tool available in that purpose (for example, it could be use to learn more and more accurate description of the actions. To learn, for example, that stacking too many cubes often lead to a collapsing of the stack)