Suppose you are reading user input and you do not know in advance how many values the user will enter. With an array, you must guess a size. Guess too small and you run out of room. Guess too large and you waste memory with empty slots.
You could work around this by creating a new, larger array and copying everything over each time you run out of space. That works, but it means writing the same resize logic every time. Java's ArrayList does that copying behind the scenes, so you never have to write it yourself.
The tradeoff: ArrayList uses slightly more memory than a raw array because it manages capacity internally. For most programs, that overhead is invisible.