For transient analysis (the card used is .TRAN), LTspice (and other Spice simulators) are often meant to simulate a circuit with an applied signal and non-linear devices, such as various semiconductors like BJTs and diodes, and devices having 'state' such as capacitors (charge) or inductors (current.) Usually there is more interest in the small-signal behavior, once the circuit "powers up", and less interest in the process of powering up, itself.
Spice simulators will usually first try to find the DC operating point of the circuit. This is called the "initial transient solution" step (sometimes shorted to "ITS"), which takes place immediately prior to \$t=0\$. This ITS step take into account the large scale non-linear behaviors of devices like BJTs and diodes, and also attempts to find the quiescent (after things settle down) voltage on capacitors and current through inductors. Once the ITS is performed then the simulation is allowed to start.
There is an option called UIC on the .TRAN card that will tell Spice to avoid this initial ITS step. The use of UIC means that Spice will not go through the ITS step. Instead, when using this option causes the initial value of every single energy storage (voltage/capacitor and current/inductor) device to be treated as zero -- except for those which are explicitly provided using the .IC card. (You can add as many .IC cards as you feel you need.)
In your initial case with the DC supply, LTspice performed the ITS step and found a quiescent DC voltage for the capacitor. Once set, the simulation started. But since the quiescent DC voltage was what things would look like "after a long time", there was nothing more to change once the simulation started up. So you just see a horizontal line.
Using the UIC option of the .TRAN card forces LTspice to avoid the ITS step and to set the voltage across the capacitor to zero and then start the simulation. Which seems to be what you wanted to see.
This is just a matter of learning more about Spice programs, generally. There are a few details like this that once you learn them, you will remember to apply them when you see a result like that. And then you'll be fine.