Why is battery technology so far behind electric car technology?

It is fairly obvious that investment in battery technology is way behind general electric car technology even though batteries are vital to the success of the EV market. Investment has grown over the last couple of years, and the battery technology we see today is improving, but it has taken some time.

How did governments, car manufacturers and technology companies allow this investment gap to grow?