@lareka you must mean the AI, the CPU (central processing unit) is in your PC/console.
In the past, the AI was just stupid and wasn't challenging, it also rarely made mistakes, which many players didn't like.
Now they are trying to make the AI smarter and more aggressive, but they should also not be too perfect and also be able to make mistakes. The AI is anything but good, but in the past it was often worse.
In real Formula 1, such overtaking maneuvers also occur when the drivers have such an opportunity, you can see something like that in almost every race.