In some games, like CS its easy to write an AI that wins every time over a human, since it will aim 100% correct, and it could scan all directions at all times, and shoot in nano seconds.
so we handicap it we make sure it are limited to what you can do as a human, we make sure it take some time to interpret what it sees, limit how many times it can look around pr. second, limit numbers of actions to what a human might have – and even incorporate some errors, so the aim is not true every time. – in other games its harder, typically if there is many ways to obtain victory, and click speed / perception speed is not a parameter.
A prime example of poor AI is in CIV VI – not only do the computer not know the objective (to win) each AI player only follows a specific strategy, even if that will clearly make a nother computer win, so you as a human player have to best not only one or but perhaps 4 computers that are trying to win by war, by religion, by tourism, by science, and doing nothing to stop another computer to win by religion, that is up to the humans. On top of that the AI is cheating on King level and up (Eg. On turn 13 the computer will have 2 cities (even though it would take at least 16 turns to build a settler, on top of that it would have 3 troops, each of which would take 10 turns, it would have 2 builders each of which would take 5-10 turns – and so on and so on.)
Here a self-learning algorithm could in a few hours of playing against itself become super strong and good – and that is what should have been in the game !