The Animation Graph holds all Animations a character will play in the game (exception: if the code is starting some animations directly). Additionally to these animation names, it holds information about when to play which animation.
A state in the Animation Graph represents an animation and the information about when this animation should be played. The white box on the right in the drawing is called Selection Criteria. Together with the asset this forms a state.
A state also holds additional information about how to play the animation, such as for example playback speed or whether or not this is a looping asset. Regular states, that hold Selection Criteria are green. Transitional States are yellow - these only contain transition animation and do (usually) not hold Selection Criteria.
The Code does not directly start specific animations (this is however possible if desired). Instead it provides information about the character and the game state to the graph. Examples: Character Speed and Item. These are called "Inputs". The graph can listen to these inputs that are being sent from the engine and use it to select animations.
The Inputs correspond directly to the Selection Criteria. The graph goes through all regular states (green ones) and compares how well their Selection Criteria matches the actual values of the Inputs. The State that matches best will be entered and its animation played next. The graph will also respect setups that require the current animation to be finished first or whether it can be interrupted etc.
There are two steps needed to set up Selection Criteria. The first is that the graph needs to tell the game which Inputs (game state information) it wants to listen to. The engine is sending the information anyway, but the graph will only take the actively registered ones into account for state selection (less inputs will make this process faster of course, and more importantly, less error-prone). The Inputs Tab in the Interface lists all the Inputs the graph is currently listening to.
The Selection Criteria that is set up on a particular state, can be found in the Selection Criteria Tab in the Properties (usually on the right) - once a state is selected. This tab will offer all Inputs that the graph is listening to and values or value ranges can be set here to determine when this state should become active.
See the Tutorials on how to set up Selection Criteria with practical examples, and on how to set up transition animations.