Icons are used to define certain UI elements that show or define "meta" information about a block. Usually this means they act as a clickable button that opens a pop up with more information or an editor.
→ More info on Fields vs Icons.
Blockly provides some built-in icons that fulfill common use cases, like adding comments or warnings to blocks. You can check out the reference documentation for more information about those.
Blockly also lets you define your own custom icons if the built-in ones don't serve your use case.
→ More info on Creating custom icons.