Back in 1888, Bertha Benz took a three-wheeled vehicle built by her husband—the one most historians describe as the world’s first car, and one that eventually led to Mercedes-Benz—and took it on the world’s first long-distance drive to visit her mother.

En route, she stopped at a pharmacy in Wiesloch to buy gasoline, which was primarily sold as a cleaning fluid. Remarkably enough, that store is still in business, and its owners advertise it as the world’s first filling station. It was the start of a long and storied history of these transportation essentials.

It seems there are two candidates for the title of the first U.S. station to specifically sell gas for cars. Depending on whose version you believe, it was either in 1905 in St. Louis, Missouri, opened by a subsidiary of Shell Oil, or one in Seattle, Washington, which opened under the brand Social in 1907.

At the early stations, the attendant filled five-gallon cans and used those to fill the car. The first gas pump that dispensed directly into the vehicle was made in 1910, and you pushed and pulled on a lever to draw fuel from an underground tank. A year later, one was developed that drew out a measured amount with each push-and-pull.

It was in Pittsburgh, Pennsylvania in 1913 that Gulf opened the first drive-in service station, where motorists pulled in off the street to have their cars filled. But in cities across Canada and the U.S., most gas pumps were installed at the curb in front of the pharmacies or grocery stores that sold fuel as a sideline.

It wasn’t until the 1920s that municipalities somehow figured out that putting flammable-liquid dispensers right next to traffic might not be the brightest idea, and many of them started insisting on drive-in stations. To maximize returns on the property investment, stations started adding services such as mechanical repairs, car washes, and battery and tire sales.

In 1930, American fuel retailer Hoosier Petroleum floated the idea of letting motorists pump their own gas at its 20 stations, but the fire marshal quickly shot that down. The idea became more feasible with the 1939 invention of a shut-off valve in the pump, and so in 1947, a Los Angeles station owner named Frank Urich pioneered self-serve.

Urich was quite the showman, and he hired young women to roller-skate around the station to collect the cash. He even had empty tankers stop in regularly, giving the impression that he had to refuel frequently to keep up with demand. It worked: he sold half a million gallons in his first month.

The second self-serve opened in San Jose, California shortly afterwards. Meanwhile, Canada’s first was in Winnipeg, opened in 1949.

Self-serve stations still needed attendants, since the pumps had to be manually reset each time. A station in Westminster, Colorado was the first to use a remote system, in 1964, letting a single employee inside the store reset each one as needed. The story goes that the device’s inventor approached station owner John Roscoe with the system. Roscoe turned him down, but his banker knew the inventor and convinced Roscoe to give it a try.

Even so, self-serve stations remained a hard sell in many jurisdictions, since the governing bodies worried that drivers wouldn’t follow safety rules when pumping fuel. Only 27 U.S. states allowed self-serve by 1968, and some required that the attendant stand alongside as the motorist filled his car, which pretty much negated the whole idea.

Even by the 1980s, some 70 per cent of American stations were still full-serve. Today, stations with attendants are rare in Canada and in most U.S. states, but New Jersey and Oregon still outlaw self-serve (although Oregon will let you fill your own motorcycle tank or pump your own diesel, which doesn’t fall under the “class 1 flammable liquid” designation on gasoline).

Using your credit card to pay at the pump originated in Europe in 1982. Speedpass, a chip-equipped device developed for Esso that let customers pay at the pump by pointing the pass at it, was initially tested in 1996 at a gas station chain in Missouri. Within five years, more than five million people were using the devices.

Today, there are an estimated 13,000 gas stations in Canada, but the number has been steadily declining from the 20,000 that were around in 1989. According to petroleum consultation firm MJ Ervin & Associates, there are some 99 different gasoline brand names in Canada, which originate at 15 refineries operated by nine refining companies.

Despite the high price of gas, profitability is a major factor in the decline. The margins are slim, which is why you’re usually encouraged to stock up on more profitable snacks or car washes when you’re there. If a station doesn’t move large volumes of gasoline or enough of the extras, its long-term viability is questionable.

And no, we’re not sure if, back in 1888, Bertha Benz was asked if she wanted a double bratwurst when she bought her gas.