Syntax difference between ' and "

Can someone please explain when to use ’ and when to use " in code.

I see some examples in HA that have " surrounding icon name, for example, but other times no quote marks and both work.

Also, after creating automations with time conditions in UI, when viewing the code in file editor the before time will have quotes whereas the after time won’t, or vice versa.

I’m confused.