Source? I haven't seen final numbers for 2023 from EIA yet, but 2022 was like 22%. The growth is accelerating as economics change, and in large part the IRA (thanks Biden), but it's not 40%. I'm speaking of electricity production, but I can't think of a reasonable metric that's anywhere near 40% nationally. Let's try to stick to reality here.
https://en.m.wikipedia.org/wiki/Renewable_energy_in_the_United_States
Capacity and generation are two different things. Grid operators have capacity markets that ensure peak load can be met, and incude generations assets, demand response, energy efficiency, etc. Batteries absolutely coumt as capacity so long as they are managed to do so.