It depends which gives you the better deal. You need to work out the total costs (the deposit, all the monthly payments, and any balloon payment at the end, and any compulsory admin fees).
When buying a used car a bank loan will almost always work out cheaper.
However when buying a new car there may be a low-cost finance offer (subsidised by the manufacturer) or a discount that only applies if you use the manufacturer's finance, which may make finance cheaper than a bank loan. However there may also be discounts that are not available if you take the finance, so you need to have all the details. You need to know the dealer's best price without finance, as well as all the details of the finance costs.