Just to be clear: in this case you can use aes() and fill in ggplot(). The key difference is really that fill goes outside of aes() when you want to assign a single color to your data .
When plots get more complicated, with multiple layers, I've found it helpful to assign aes() per layer (as I showed above), so I've gotten in the habit of splitting them out.
If you want to assign colors based on the data itself, then you should place fill inside aes(), and point to a column:
ggplot(data = penguins) +
geom_bar(aes(x = species,
fill = island))