The Tesla Roadster came out first, by a couple years, but only sold about 2500 over its lifetime. By the time Tesla got its second model out, a couple years after Leaf went on sale, Leaf had 50k sales.
It took until 2020 for Tesla cumulative sales to catch up with Leaf cumulative sales.