That's a bit lengthy to explain, but in short it is the syntax of the language, and the error is probably one that every beginner to programming commits.
In short: the function has one single argument 'state_list', but with IDLE, WANDER you pass in two. The interpreter can't make sense of it, so it shows an error and refuses execution. GDScript's syntax for an array is a comma-separated list [1,2,3], so that's the right form of saying this.
Maybe your confused because there is no explicit data type. The interpreter (and the programmer) sometimes just have to guess them. This is called duck-typing.
You can read all about GDScript here, and don't worry, this may all take some time to sink in:
https://docs.godotengine.org/en/latest/tutorials/scripting/gdscript/index.html