Hello
Is that the enemy code, and does areaExported2.global_position is the player location?
If yes, then this logic says that when the player jumps you will set the enemy vertical velocity to follow the player jump.
var velocity = (areaExported2.global_position - global_position).normalized()
So, if areaExported2.global_position.y increases (when the player jumps) you will also add y velocity for the enemy. I assume that is why the enemy jumps.
If you want your enemy to run on the ground (maybe they can jump too) you probably need logic that handles x and y components separately. For example, If the player is to the left, head left. If the player within a certain distance and above, jump. And you might get into complexity with path finding if you have platforms...
If you can explain what you want the characters to do maybe somebody can help
Also, I don't understand what you are doing with the GRAVITY variable. I would expect that gravity should just work downwards, but you have both x and y coordinates. You probably only want to add y velocity based on gravity.