Shellac is made from the secretions of the lac beetle and is not vegan because it comes from an animal. The beetles secrete the resin on tree branches in Southeast Asia as a protective shell for their larvae. The males fly away, but the females stay behind. When the flakes of resin are scraped off the branches, many of the females who remain are killed or injured. Some branches are kept intact so that enough females will live to reproduce.
Shellac is used in a variety of ways, including foods, furniture finishes, nail polish and other applications. In foods, shellac is often disguised as "confectioner's glaze" on a list of ingredients, and creates a shiny, hard surface on candies.
An insect's nervous system is different from a mammal's, but they do have a nervous sytem. Some question whether insects are capable of suffering, but it's been documented that they will avoid unpleasant stimuli.
The resin of the lac beetle is sometimes called "lac resin," and may be used to coat fruits and vegetables to keep them fresh and pretty.