Movie trailers have been around since at least 1912, but they didn’t always run before the movies they’re attached to.

In fact, movie trailers (as you might guess by their name, trailers) used to trail behind films in theaters, not before them. Nowadays, the thought of showing advertisements for upcoming films after movies instead of before them makes little sense, because with the main attraction over with, why would the audience stick around to watch commercials?
Above: A screencap from the “Casablanca” movie trailer
The answer is that often times in the early days of movies, the main attraction wasn’t over when the movie finished. It was common in the early decades of movies to show them in double features– i.e. one movie right after another. In the 1920s, 1930s, 1940s and so on, trailers would often play after the first movie and before the second (which was often the blockbuster movie that people had come to actually see; the first was often a B-movie).

Starting in the 1920s and 1930s, theatrical trailers were often supplemented with newsreels, public service announcements, and short animated films, in a precursor to the diversity of modern day television programming.

Early on, trailers were cobbled together by individual theaters hoping to promote upcoming films, but soon the studios got into the act, eventually sub-contracting out the task of creating trailers to outside companies (a practice which is still largely followed today).