How does exactly ICO work? What the advantage of ICO for companies?
Cryptocurrencies, and by extension issued tokens, live in a legal grey zone.

ICOs are just a means to use blockchain-issued tokens as a funding mechanism. If it weren't for the legal grey area, it seems to me that they're exactly the thing that investor accreditation laws are intended to prevent: raising money from people who are vulnerable to being scammed.

From what I've seen so far, almost every ICO is just lots of talk, without any indication that there is a plan or competence to implement anything but the off-the-shelf ICO smart contract. In other words, a modern incarnation of a pump-and-dump scam.

So to answer your question: the advantage is raising lots of money quickly, without needing to follow up on any promises.

I believe that ICOs are putting the whole ecosystem in a bad light, and are likely to result in legal problems.