Little Background:
I own 2016 Mazda CX-5, battery that came with car was not holding the charge for long, so after some research on which battery to replace it with, I decided to replace it with Walmart brand as many people recommended that Walmart's brand(EverStart) is a good brand for car batteries. I replaced the old battery with the new one in April 2020.
Fast forward to yesterday: I tried to start my car but the starter struggled and car did not start. I used a jumpstarter but nothing happened. Todays I asked my friend to bring over his car and to jumpstart my car. Aftert connecting the jumper cable, the car started in first attempt but it stopped immediately when I took the cables off, we tried agian, car started and stopped as soon as I remved the cables. I doubted, it could be alternator has gone bad but I decided to take a last attemp and connected jumper cables again and left the cables connected to let the battery charge. Before charging I checked the battery voltage with multimeter and the battery voltage read 3V. After leaving the battery connected with my friend's car with engine on for like 5 min, I took battery voltage readig and it read 12V. This time I tried to restart car without jumper cables connected and car started fine, I left it running for like 15-20 min and engine kept running fine.
Now with engine on I took voltage reading to see how many volts alternator is generating and it read 13.86V, I revved the engine to see if voltage fluctuates, but it stayed 13.86V, I turned light on and music system on high volume to increase the load on alternator to see if that affects the voltage but still reading was in 13.82V to 13.86V range. I drove the car for a couple of miles and everuthing seemed normal.
Now I am confused why the battery was drained, I did not left anything running in car. This car has auto lights shut off feature so there is no way headlights or interior lights would have stayed on to drain the battery. Why car was turning off immediately after taking jumper cables off.
How to diagnose if the battery is bad or alternator is bad? Apologies to make the question this long.