What it is:
A trademark is any legally-protected abstract or figural representation or slogan associated with a company or product that deliberately differentiates it in the market.
How it works/Example:
A trademark is a marketing device that visually sets a company or product apart from similar items trying to gain market share. Trademarks are forms of intellectual property that are unique to a company and or its products. Slogans, symbols, or inventive catchphrases are common examples of trademarks. Companies legally register their trademarks with the appropriate authorities in order to prevent competing companies from copying (called infringing upon) their trademark or trademarks (explicitly designated by the superscripted "TM"). Infringing on a registered trademark is illegal and may be used as justification for legal action by the company which legal rights to that trademark.
To illustrate, suppose company XYZ produces a cleaning solution for eye glasses called CrystalensTM (a clever contraction of the words "crystal" and "lens") for which they have a valid registered trademark. Should another company infringe upon this trademark by copying the name Crystalens verbatim or in part, then company XYZ is justified in suing the infringing party.
Why it matters:
In addition to differentiating companies and products in a given market, the use of trademarks is a marketing strategy that encourages recognition and association of some level of quality among consumers. Registered trademarks ensure fair, competitive practices in the market while protecting the owner of the intellectual property rights.