The key point here is that the portfolio must be self-financing, namely the initial option premium $V_0$ should be enough to allow you to hedge it throughout its life. If not, the option price $V_0$ is either too low or too high.
Because the option is written on the asset $S$, buying or selling $S$ is how you neutralize the changes in value of the option: for example, if you are long a call option and you need to hedge it, you know its value will increase if the asset price increases, therefore you need to be short the asset in a quantity $\Delta$ to neutralize the gains you make on $V$ when $S$ goes up and vice versa.
However, the value of the asset holding $\Delta S$ will not always perfectly offset the value of the option $V$. The deposit account $D$ allows you to match things: you might withdraw or contribute to it if you need to modify your holding $\Delta S$ in order to neutralize movements in $V$.
This is because options are non-linear derivatives: linear derivatives such as forwards only need the underlying asset to be hedged because a price move in the asset has a linear impact on the derivative price, however in the case of options we know the price has a non-linear behavior to changes in the underlying. For example, if you are long a call option you have:
Therefore if the price of the asset increases we need to be able to drawn cash from a deposit to keep increasing our allocation $\Delta$ in order to hedge $V$.
There are multiple ways to express the hedging portfolio but they all can be pinned down to an equation of the form:
Namely a position $a(t,S)$ in an option $V$ needs to be hedged with the asset $S$ which is bought or sold in a quantity $b(t,S)$; any required additional financing $c(t,S)$ must be borrowed or lent at a rate $r$.
Finally, note that the portfolio $V-(\Delta S+D)=0$ you mention in your edit yields the correct PDE but is not self-financing: see my answer Dynamic Delta Hedging And a Self Financing Portfolio. Indeed, suppose at some time $t$ you are required to change your allocation $\Delta$: where does the money come from? You need to have a coefficient assigned to $D$ so that any withdrawal/contribution to the deposit offsets any change in the asset's allocation: