A trademark is an indicator of the source of goods, while a service mark is an indicator as to the source of a service offering. In other words, a trademark or a service mark is a brand identifier for consumers, and each can include any word, name, symbol, device, or any combination, used or intended to be used to identify and distinguish the goods/services of one seller or provider from those of others, and to indicate the source (and in theory, quality) of the goods/services to the relevant consuming public. Even a product's "trade dress" (that is, general "look and feel") can sometimes be registered as a trademark or service mark, if such trade dress has acquired distinctiveness amongst the relevant consuming public. For example, think about the "look and feel" of a glass Coca-Cola® bottle, whose wavy/hour-glass shape has enjoyed the protection of a federal trade-dress registration for nearly a century.
Originally, trademarks/service marks were merely the domain of State and/or Common Law. However, in 1881, the U.S. Congress, exercising its powers under the "Commerce Clause" of the U.S. Constitution, enacted federal trademark laws to better deal with the impact of trademarks in interstate commerce. Later, Congress would pass the Lanham Act in 1946, which is the basis of the state of U.S. trademark law today. While there are some U.S. states that have state-based trademark-registration systems, such systems and associated laws have little teeth when it comes to dealing with the larger, nationwide stream of commerce. Thus, while it is not mandatory that the users of a given trademark/service mark federally register it, it is generally more advantageous to do so, as there are many federal protections that come with a federal registration. Among the advantages are a constructive notice to the public of the registrant's claim of ownership of the mark, the legal presumption of ownership nationwide, and the exclusive right to use the mark on or in connection with the goods/services listed in the registration.
Trademark law protects a company's goodwill, and helps consumers easily identify the source of the things or services that they purchase. As the marketplace has become more complex with the growth of the Internet and domain-name registrations, U.S. trademark law has been extended to address such things as bad-faith cybersquatting on domain names and trademark dilution.