Why do we use an AI Controller?

Watching a lot of tuts on Youtube. I have seen methods of programing your enemy’s AI. But I don’t understand why you make the event in the character. Then make the event again in the AI controller. Then make the event again for the behavior tree task in another Task blueprint. why can you not just make the one task in the character and cast to that and miss out the AI controller or would that not work? I am still new to this.

Take this for an example. lets say I want to make a simply wondering and then chase on sight (OnSeePawn).
I could make that quite quickly in a character BP and set the max walk speed to change with a few variables. and then on see pawn set AI MoveTo to my player character and then so on to attack on contact with the mesh and lower health and so on. That would be job done.

Or should I just have the custom events in the AI character and the do all the coding in the AI Controller is that the better practice or something. then use the behaviour tree with tasks BPs

There is no reason to make the same event 3 times in the AI controller, a behavior tree and then in the AI pawn BP. I don’t know what tutorials are doing that but that seems ridiculous. Depending on the complexity of your AI you may choose to script the logic in either one of those 3 places but not all 3. If you are using a behavior tree you require an AI controller. If you don’t use a BT you can do everything in the AI pawn BP. If there is common functionality between types of AI, say a stationary AI vs a mobile one, both shoot the player so both need code to recognize and target the player this would best be coded in the AI controller or a BT as those could easily be shared between AI. If it is in the pawn BP you would need to code for each AI class the same logic to find and shoot the player. Those would be the basic reasons for using one over the other.