U.S. crude oil exports are surging, even as we continue to import millions of barrels per day. The reasons for that come down to logistics and refinery economics.

In the years leading up to the shale oil boom, crude oil exports from the U.S. were nearly nonexistent. There were two reasons for that.

First, following the 1973 OPEC oil embargo, a crude oil export ban had been enacted as part of an energy bill that aimed to mitigate future oil crises. The crude oil export ban restricted crude oil exports from the U.S. to all countries besides Canada.

But even if the ban hadn’t been in place, U.S. oil production severely declined for over three decades after 1970, even as U.S. crude oil consumption grew. So, over time, there simply wasn’t as much crude oil available for export. (I use that phrasing with the caveat that the U.S. has been a net importer of crude oil and petroleum products since 1949. More on that below).

As crude oil production in the U.S. surged, the dynamics began to change. Aided by the crude export ban, the longtime West Texas Intermediate (WTI) premium over internationally traded Brent crude vanished and WTI began trading at a discount.

U.S. crude oil producers had to sell their oil to U.S. refiners, who were happy to refine the discounted crude and then export the finished fuel products at full price (because the ban didn’t cover finished products).

Crude oil producers lobbied for an end to the export ban, and in late 2015 they got their wish when President Obama signed into law the Consolidated Appropriations Act, 2016. This $1.15 trillion spending bill contained a provision that stated: “To promote the efficient exploration, production, storage, supply, marketing, pricing, and regulation of energy resources, including fossil fuels, no official of the Federal Government shall impose or enforce any restriction on the export of crude oil.”

In 2016, the U.S. exported crude oil to nearly 30 countries. In 2017, monthly exports have exceeded one million barrels per day (BPD) on multiple occasions.