This is a pretty general question with many different approaches. I'll just mention two major differences in coding AI logic into Lua.
As a prerequisite you will still need to expose C/C++ low level functions so that lua can make function calls to affect game systems or query for game information.
Movement, pathfinding, inventory, etc, etc
Script as low level decision logic
Basically you can use script for the very core decisions. How an AI may select a target, or how an AI chooses which weapon to use, etc. Think of lua functions or individual scripts as very small amounts of AI behavior.
This would mean C/C++ would call a function on the lua side, passing in values where the decision logic comes up with the result and passes the result back to the caller.
This type of approach works very well when the overall structure of what makes up an AI is in code and can be constructed either through hard coding or from a data source.
Structures like Finite State Machines with states in lua, or Behavior Trees where individual tree nodes are coded in lua fit perfectly in this model.
Script as high level decision logic
A completely different approach is to allow the lua script to completely control the AI. In this sense you could have a "think" lua function that is called every tick which represents the AI logic. The "think" function would need to be ticked either per frame or whenever is appropriate for the game you're making.
For example if lua is controlling animation playback it would probably need to be ticked per frame to have control over animation handling.
This approach isn't structured except for the known function that C/C++ calls into for the specific AI. All AI structure and logic can be written in any form you want in script with the AI storing any persistent knowledge as global variables in lua.
These are just two very different high level approaches to using scripting. Of course not taking into consideration memory or performance of the AI.