Plus, the e-commerce sites that use it are usually small startups. They need to show that real people are buying from them to prove to shoppers that they're legitimate
You have to see it as a part of a broader persuasive effort. By itself, it doesn't work. But when it is paired with reviews, testimonials, ratings, high-quality pictures, etc., it adds to the impression that this is a legitimate product
In these cases, you're being pressured to act fast before the hotel/restaurant is fully booked. Further, this "proof" that people are making all these reservations right now also could make you believe your choice is a popular recommendation, persuaded your decision making.
So, say you're interested in a certain smaller brand that may not sell thousands or more copies of certain items, but something on the order of 50, or 100, etc.., then when you see that others have been purchasing said items you worry you'll miss out on your chance to buy one, and then you'll be one of the only people who like the brand who don't have said item.. thus, you wind up purchasing too.