Marketing can take many forms. Many people narrowly define it as "spam emails" or "unsolicited phone calls." Those are also marketing, but there is so much more. Marketing first and foremost informs. It can inform you that the problem that you have has even has a ready solution. It can inform you about the name of the product that solves your problem. It can inform you about alternative products that also solve your problem. Or it can reinforce and expand your existing opinions and believes. What you call the sole purpose is only one of these broad purposes of advertising.
Remember the time you learned of a particular programming library that does the thing that you wanted to do? Without marketing, you would not have learned about it.
Have you ever gone on a trip to a new place? How did you decide how you will spend your time? It was either because you researched things online and found websites that told you about those things. Or you saw a brochure at your hotel. Or an ad at the airport.
Think about how you learned about your favorite web framework. It was likely through word-of-mouth advertising.
Why do you drink (coke / pepsi / fav. brand of tea / fav. brand of coffee)? What formed your opinion was some kind of marketing, either directly, or indirectly.
Many things we do and believes we hold are because of one form of marketing or another.