Today the electric car company Tesla Motors is expected to announce it has turned a profit for the first time. That’s in part because of the success of its Model S luxury sedan, which costs anywhere from $70,000 to $100,000. But what has also led to those profits is money that Tesla made from selling California Zero Emission Vehicle Credits to other car companies.

To understand the complicated world of California’s credit system I thought I would start by visiting a Tesla store in Santa Monica, just a few blocks from the Pacific.

In the spare, white-tiled showroom at the Third Street Promenade, an upscale outdoor mall, I met Tesla’s manager for the Southwest region Jeremy Snyder.

“The Tesla store experience is unique because we own all of our distribution and unlike dealer franchises, we control the entire experience,” Snyder said.

This is the first point in a very long list of ways that Tesla different is from every other car company Snyder explained. Another: Tesla keeps only a single car in its showroom — the Model S.

Snyder led me to an alley behind the store where he keeps the test drive models.

“Why don’t I drive first. It will be easier to blow your mind,” Snyder said. He then touched a chrome panel below the driver side window and the door handle emerged from the side of the car.

We drove up the Pacific Coast Highway and it was kind of a mind blowing experience. The car accelerates with G-force speed. According to Snyder, Blue Angel fighter pilots have described it as the closest thing to an F-18 fighter jet on four wheels. He pressed down on the accelerator and we descended the on ramp toward the beach.

“That’s what we call the Tesla grin,” he said.

But perhaps its greatest engineering feat is its range of 300 miles on a single electric charge. And now the Model S can turn a profit thanks in part to California’s Zero Emission Vehicle Credits.

“The Zero Emission Vehicle regulation is a requirement that’s placed on the large auto makers to make and sell zero emission vehicles,” said Ana Lisa Bevan, with the California Air Resources Board. The board requires auto makers to turn in a certain number of credits per year.

Companies earn those credits by making and selling zero emission vehicles.

“So if a manufacturer has sales in California of, let’s say, 100,000 vehicles, and the obligation is credits equal to one percent of their sales, they have to come up with 1,000 credits,” Bevan said.

If a company comes up short, it has to pay a penalty of up to $5,000 per credit. Or it can buy credits from a company like Tesla, which happens to earn a lot of credits on every car it makes.Tesla has sold enough credits to post its first profit.

Correction: The original article misstated the title of Jeremy Snyder. He is Tesla Motors’ manager for the Southwest region. The text has been corrected.