A trailer is an advertisement for a future feature film that will be shown in the theater. In the early days many decades ago movie ads used to be shown at the end of the film, so they "trailed" the movie. However, this practice did not last long, because viewers tended to leave the movie house after the film had ended. Trailers are now shown before the film begins, but the name has stuck even though they no longer trail the movie.
The first trailer was screened at Rye Beach, a New York-area amusement park, in 1912. According to Paramount executive Lou Harris, as quoted in the Los Angeles Times.:
One of the concessions hung up a white sheet and showed the serial "The Adventures of Kathlyn." At the end of the reel Kathlyn was thrown in the lion's den. After this "trailed" a piece of film asking Does she escape the lion's pit? See next week's thrilling chapter!
Hence, the word "trailer," an advertisement for a coming picture.
Around this time movie houses also began to separate back-to-back double features by displaying information about future releases. In those days, credits preceded the movie, which meant that as soon as the words "The End" appeared on screen, projectionists could flick on special still slides labeled with the title and studio of other movies they were planning to show. With moving pictures being so new and novel, people would come in the afternoon and stay all night and enjoy multiple showings of the same program. The idea sounds crazy, but in the 1910s, the novelty of moving pictures hadn’t worn off. To make room for later showings, why not take a break and show some stills for next week’s shows? Instead of spending the rest of the night in the theater, movie houses tried to entice people to come back next week for even more fun.
In 1916, Paramount became the first studio to officially release trailers, though they only bothered to spend the extra effort with their highest-profile films. By August 1919, the studio had set up its own trailer division and was actively assembling previews for all of their upcoming films.
The first recorded use of the movie trailer for short advertising is when the US entered the First World War and war bonds known as Liberty Loan Bonds were being actively sold. Found in the New York Times of June 2, 1917, reporting on the movie industry's participation in the war bond effort:
A committee of the National Association of the Motion Picture Industry yesterday began sending films known as trailers [advertising the bonds] to all of the 15,000 or more movie theaters in the United States. These films are seventy feet in length and will be attached to longer films that are shown at every performance.
The advertising industry was just beginning to recognize the importance of the movie theater audience.
It was in the 30s that movie trailers really began to evolve beyond simple newsreel-style sequences of movie clips to include sophisticated graphics, and by the end of the decade they had their own narration and musical scores.
Most modern movie trailers have a three-act structure similar to a feature-length film. They start with a beginning that lays out the premise of the movie. The middle drives the story further and usually ends with a dramatic climax scene. The last act often consists of a visual montage of powerful and emotional moments in the film and may also contain a cast run if there are noteworthy stars that could help sell the movie. The last act may also feature some type of "signature music" (recognizable song or a powerful, orchestral piece). Trailers tell the story of a movie in a highly condensed fashion that that has maximum appeal. Over the years movie marketing has become a large industry and trailers have become highly polished pieces of advertising, able to present even poor movies in an attractive light.
Another term that has survived from the early movie era that is the “B movie“. Back when movies where shown as a double feature, the first movie was referred to as the "B movie". Movies were specifically made with B-movie intentions, with lower budgets and sub-star talent. In order to sell these movies of sometimes lower quality, the studios required cinemas to buy them as a package as A and B movies. This practice was made illegal in 1948, which shook things up for the major movie studios and ended the “golden age” of Hollywood.
 Thomas, Kevin. "Movie Trailers Have Long Run." Los Angeles Times. 25 October 1966: Part IV, Page 10.
Thompson, Frank. "Drawing a Crowd: 100 Years of Movie Marketing." 25th Annual Key Art Awards Exhibition Catalog. Los Angeles: Hollywood Reporter, 1996. 10-24.