Rather like the car, think of panels as buying 20+ years of electricity upfront rather than being exposed to market rates. You can buy a car upfront, on credit, lease it, or rent it; in all of those the longer you commit the cheaper it is.
Not for everyone, but definitely for homeowners with suitable roofs and local utilities.