Why do firms advertise? Even when goods are interchangeable?

Many firms advertise their goods or services, but are they wasting economic resources?
Some economists reckon that advertising merely manipulates consumer tastes and
creates desires that would not otherwise exist. By increasing product differentiation and
encouraging brand loyalty advertising may make consumers less price sensitive,
moving the market further from perfect competition towards imperfect competition
(see monopolistic competition) and increasing the ability of firms to charge more than
marginal cost. Heavy spending on advertising may also create a barrier to entry, as a
firm entering the market would have to spend a lot on advertising too.