I think the “stars” (or their agents, or somebody in the industry)pay for those things as a publicity thing.
That is correct. Getting a star on the Walk of Fame is not a "great honor" being bestowed on an actor or actress in recogition of their talent or contributions to the entertainment industry. Anyone can get one of these. All you need is the money to pay for it, and an agent who will set it up for you with the local officials.