The first use of "illusion" referred to an actual illusion. The second use referred to illusion in general. An article is not used in the second case.
Student or Learner
I am reading a book and it's called Utopia by Lincoln Child. I have found a passage where you have the word "illusion" with an indefinite article, as expected. However, in the next sentence there is "illusion" without an article. How come? Could you explain that? Here is the text:
I have made a photo from that book, so you can see it's like that in the book.Of course, the kid had no idea he was ascending through a cylindrical screen, displaying a digital image beamed from two dozen projectors onto the fiber-optic lights of the cityscape. It was an illusion, of course. At Utopia, illusion was everything.
"Illusion" can be both countable and uncountable.
That illusion was great.
This illusion is better than yours.
Illusion forms a large part of a magic show.
The last sentence wouldn't make sense as "An illusion forms a large part of a magic show" - that suggests there is just one illusion in each show. You could argue that "Illusions form a large part of magic shows" and that is true but using the general term "Illusion" is better.
Remember - if you don't use correct capitalisation, punctuation and spacing, anything you write will be incorrect.