Battery voltage could be the issue
After sitting for a few hours, NOT charging, and hooked up to vehicle, measure battery voltage:
12.8v+ is a new battery
12.5v is 3 to 4 year old battery
12.3v is 5 to 6 year old battery and time to look for a battery sale
12.2v or under is failing battery
If you can see voltage dropping slowly with volt meter hooked up, then battery has an internal short, so is self draining, common end to most older batteries.
It will hold enough of a charge after driving for quick restart, but if it sits for a few hours it will drain down to low for good start
Computer, fuel injectors, and coil pack all need above 9.5volts during cranking for good startup
Most starter motors will draw down about 2 to 2.5volts when cranking
Also test battery voltage after startup
14.5-14.9v is common after startup
After a few minutes of ReCharging voltage should drop to about 13.6volts, this maintains battery voltage without "cooking it", over 14volts long term will shorten the battery's life
Alternators voltage regulator does this voltage change, and they can fail at "full charge" which will cook the battery