Solar panels prices dropped sharply when Chinese govt ordered them to. It was a planned action, and had little to do with technology progress. About 10 years ago billions of government subsidies were thrown in, zero interest financing. Panels were being made in every backyard and sold at every corner. All happened very quickly over one year period, prices dropped so low that nobody else could stay in business. US and European solar manufacturing was decimated and never recovered. China was left with an oversupply of panels for a while and sold it to 3rd world countries below the cost.
Who is keeping desktop computer a few years only? In most offices that I've been, workstations were at least 5 years old. Servers are a different matter.
Cellphones are getting thrown away after two years because they are not made to last, poor quality. Besides, consumers don't take proper care of Lithium battery, keeping it On all day whether they need it or not, and frying it on the charger all night. It takes 5-6 years for a smartphone to become notably obsolete to the point when it becomes incompatible with many new apps. Flip phone could last 7-8 years, subject to battery condition.
Having said all this, - batteries do seem to develop at much slower pace than electronics.