Celebrities make a large amount of money from appearing in television and movies, but they can augment their already large income by appearing in commercials. Celebrity endorsement are ways for brands to get some of their best advertisements. They can promote their best products with famous people. A celebrity already has an audience, so the company knows that they can potentially associate their brand with one of these celebrities.
These celebrity jobs aren't always as easy as sitting still for a photo shoot. They sometimes require years of commitment. Say you were a famous person working for Pepsi. Don't even think about picking up a Coke. A paparazzi could snap a shot of you doing that, and you might get sued by Pepsi for breach of contract. While you're under contract as a spokesperson, you need to be fully responsible for making people believe that you use that product. Because you become a proxy for that product.