Its sole purpose is to get people to buy shit they do not need, in order to make someone more money than they deserve. All through manipulation of your brain.
In a platonic world, marketing is for getting word out to the community of a product or service. For example - "I suddenly need a back doctor and don't know any", or - "I wish there was some place in town that had organic shallots and asparagus and watercress, locally-sourced honey".
In the real world, the tool is used and abused beyond the breaking point; before we even realized how we got there, we were bombarded by insurance ads from all sides simultaneously. Political ads. Male enlargement pills. Online casinos. Pharmaceuticals, with the fast-talking asshole at the end warning about "suicidal thoughts" and "serious risk of stroke" that comes along with their shit product.
The platonic ideal of marketing is always there. There is a flow of useful information. Unfortunately, it's buried and intertwined with a flood of noise and excrement.
Consumers would just search for those kinds of products themselves if they encounter a problem they feel the need to improve. They don't need to be told those products exist.
This is objectively not true. Not everyone has every idea to solve every problem. Sometimes someone fixes a problem you didn't know you had. Happens all the time in hobbying for example.