Solar is breaking into a power market that’s long been the domain of big, conventional generators. A key reason: batteries.