With subjects like that, AWB really struggles. It works along basically the same lines as auto-exposure, which looks at the entire scene, scrambles all the bright and dark tones into a porridge, assumes this will even out to a mid-tone, and sets an exposure which puts that tone in the middle of the histogram. AWB assumes that when all the colours are mixed up, they will even out to neutral grey.
In the same way as auto-exposure has difficulty with subjects that are predominantly light or dark, so AWB is prone to errors when subjects contain a lot of one colour so algorithms are overlaid to ignore or down-weight them. Systems may also look for the brightest area, assume that is clean white, and use it as a reference. There are numerous of other variations that may be factored in, such as a large area of blue at the top of the image is likely to be a sunny sky, or a large area of green at the bottom is probably grass. Things like focal length and focusing distance can also be used to give the system a clue about the subject. In the past, some cameras had a little window on top that attempted to read the colour of the prevailing light, which seems like a good idea as that's the main determining factor, but it hasn't caught on.
Given the potential for getting white balance hoplessly wrong, it's amazing how clever most modern cameras are at getting it there or thereabouts. However, if you want accurate and consistently accurate colour, use one of the presets (daylight, flash, shade etc), or do a custom white balance, or - the easy option - correct it manually in post-processing.