A trademark is a legal protection that a person or corporation can acquire for a certain distinctive brand name as well as distinctive brand image characteristics (such as certain styles, fonts, shapes, colors, etc.) when used in a certain context. The purpose of trademarks is to protect the owner from counterfeit products that are deliberately made to look the same, or very similar, for the intent of being mistaken for the original product.
A product name, when used in a certain context, can be trademarked. (For example, the name of a detergent can be protected in this way, when used in detergent containers. Or the name of a beverage, when used in soda cans.) Moreover, certain styles, shapes, fonts, etc. can be trademarked ("trade dress") when used in such a context. For example, not only the name itself of a beverage may be trademarked, but if it's printed with a very distinctive way, like using a certain font and coloring, that can be trademarked as well (so that similarly named products cannot use the same style to make it easier to confuse the consumer and make them mistake it for the original.)
Many people think that this is just corporations being overly protective and greedy of their property, opportunistically suing people for even the slightest of random resemblance with some product of theirs. However, trademarks actually benefit the consumers too, and this is something that most people don't realize.
When corporations strongly protect their trademarks, quickly and efficiently removing all counterfeits and knock-off products from the market, this creates an actually desirable situation for the consumers. This is because when you buy a product, you can be sure of who made it. You are not buying a product blindly from an unknown source, but you can be assured that it has been made by a proper corporation obeying the safety laws and regulations of your country, and who can be held properly responsible if there's something wrong with the product.
Suppose you are buying a beverage, for instance. Wouldn't you prefer it was made by a known company that obeys the safety regulations of your country, and who will be held responsible if something goes wrong? Rather than, you know, buying a beverage manufactured by who knows what entity, who knows where, under who knows circumstances.
When you see a familiar logo or name on the beverage can, you can be certain that it's almost certainly safe to consume. That's because the company that manufactures it is so strict about their trademarks and fights off any knockoff counterfeit products made who-knows-where that might attempt entering the market.
It's not always about health safety either. If you are buying, for instance, some kind of device, you can be certain that it has a warranty that will protect you if the product is defective (at least in most countries). If, however, you were duped into buying a counterfeit version of the product, and it turns out to be defective (or even dangerous), well, you simply lost your money. There is no warranty.
That's why trademarks, and corporations fiercely protecting them, are a good thing, even for the consumers.