How to create Momentum/Scripting (similar to EA's sport games)? Better explained inside.

I do not know the exact term for this, but in many racing games (and even in EA’s games, even though they deny it) the game is built to where if you start getting a large lead on your opponent, then the opponent will actually get better all of a sudden and make the lead closer or even beat you just for the sake of challenge and keeping things close. I want to tie in a similar effect in my game I am currently prototyping (planning on releasing). It is an arcade-styled tank game where you have X number of levels with 4 quads per level. The goal is to beat everything in that quad to automatically move onto the next quad or to get to the gate in your quad to move on without necessarily having to beat every opponent in that quad. The player tanks will have levels that you can upgrade that will make your tank faster, stronger, etc. etc. Anyways, I want to make it to where the player won’t be able to use the starting, basic, low-level tank to beat the game and actually make it to where the player has to upgrade the tank to a specific level before he is actually able to beat the AI. I don’t want to come out and straight up state “You must have tank level X to beat this level”, but build it into the gameplay. I know this might be advanced, but I’m just wondering how you would go about setting it up? I’m not asking for someone to create an entire AI for me, just give me some points on how to handle this.

Hopefully I explained this fairly well, if not just ask and I will try my best to clarify better.
Thanks in advance!

In general, what you want to do is figure out the math that drives your behaviours. Once you have that you can add adjustable factors to reduce/increase difficulty.

To use your EA Sports example, say your player is running with the ball. The AI is chasing him. Your acceleration / top speed functions can have a factor assigned to them. When the AI is getting further away, you increase those factors, making him able to accelerate faster, and reach higher top speeds. If the difficulty level is higher, you can scale that factor. again, it comes down to the math in the background, other “cheats” you can use is to give quicker response times, loading times, accuracy and so on, which again, you can scale with factors to get more difficult / easy beahviour