A lot is riding on your electrical panel and service. Major failures such as the one pictured here can produce fires and sudden power loss. In this case, the screw terminal was glowing red hot and sputtering metal (the dark crud is once-molten metal). Loose connections and slow corrosion over time can do that. Sometimes, panel replacements are emergencies, and the issue is only known about once power is lost to half or all of the house. Other times, they are more of a convenience, either to replace aged equipment ahead of their eventual failure or to upgrade to a higher service rating.
Being the most central component of your home's electrical system, panel and service replacements are a critical task that you should trust only to a licensed, insured, and knowledgeable professional. I have personally installed on dozens of panels and services over the years, from small 60A subpanels up to 200,000VA distribution gear in data centers (residential panels are a bit easier).
Part of the installation process is reviewing your home's grounding system and making necessary upgrades, which often includes adding bonding to your water and gas lines as well as installing a new ground rod system to ensure you are safely grounded throughout and protected from lightning strikes. Additional surge protection is available and recommended, and required in many cities in the area, further protecting you from lightning and transient

There isn't a hard and fast age at which panels need to be replaced. Many aggressive upselling occurs by some contractors for panels as young as 25 years, however this is rarely justified in my opinion. There are a number of considerations. I would first consider the actual condition of the panel - corrosion, indications of overheating, and workmanship. Any indications of overheating (discolored or warped metal) are a strong signal.
Corrosion is more commonly a cause of trouble (which leads to overheating and major failures). In the picture adjacent, you can see a panel I had to replace in an emergency setting. The panel had seen water leakage, and the contact points for the main breaker had rusted along with the breaker's internals. The panel was on borrowed time, but luckily we were able to replace it before a fire started.
I assign grades to panels akin to health grades.
Good - no significant rust
Fair - superficial rust
Poor - rust is beginning to coat terminals
Critical - heavy rust on the busbar or main terminals
There aren't exact ages for when to consider replacement, but here is a good rule of thumb that I feel is neither too aggressive nor too lenient with your safety:
<40 years = rarely necessary; requires strong reason for replacement
40-50 years = inspect occasionally; be prepared to replace
50-60 years = replace readily; failures increase with age
>60 years = default to replacement; requires strong defense to keep
For reference, HUD (federal housing for Section 8 and other programs) indicates an average usable life for panels at 50 years. Fannie Mae indicates 40 years. InterNACHI (home inspectors association) indicates 60 years. Certainly, many panels can exceed 60 years in service, but the increasingly marginal lifetime cost difference versus lowered reliability and risks of major fire aren't worth it.

Before
New additions to your home can require upgrades to your existing service to accommodate the added loads. Service upgrades are involved projects, likely requiring alterations including:
It's also a good time to consider upgrading your circuit protection to GFI and AFI.
The total cost varies considerably from home to home, with the majority of the cost often being for the utility company (upgrading the underground wiring and transformer), which is often in the mid-5-figure range.
LOAD CONTROLLER
A cheaper alternative, if only a single load (such as an EV charger or induction stove) is exceeding your home's capacity, is a load controller. Installing a load controller or load shedding device for a single high-amperage circuit can cost 10% as much as a full service upgrade.

After

There was a rash of poorly designed electrical panels installed in the 20th century, primarily of two designs: Stab-Lok (Federal Pacific) and Zinsco. These designs do not perform as they should and are fire risks. Testing has shown that the breakers may fail to trip when exposed to high currents, which can create dangerous overheating and fires both inside the panel and at the outlet where the load is connected. Field evidence has shown that these breakers can become welded into the panel due to the heat, and may have poor contact with the panel due to their design flaws, leading to arcing, which eats away at the panel bus and leads to a rapid increase in fire risk.
Federal Pacific was further found to have falsified its in-house test results, ultimately leading to the bankruptcy of their company. Zinsco also eventually went out of business, with its models and poor designs being purchased first by Sylvania, and then Challenger (and these brand lines were later purchased by others during industry consolidation in the late 20th century). However, not all Sylvania or Challenger panels utilize the Zinsco design, and it is purely the Zinsco design that we have strong evidence for being dangerous. Simply having a Sylvania or Challenger panel (common in the West Suburbs) is not cause for immediate replacement, but you should have the panel checked by an electrician to see whether it is of the dangerous design type or has taken damage.
As a further concern, many insurance companies are starting to refuse coverage for homes with these problematic panels, and even if you are willing to put up with the increased risks, you may find one day that your insurer is not, leaving you in a bind and without coverage until a new panel is installed. Additionally, many home inspection companies will fail an inspection if they come across these panels, making the eventual sale of your home difficult. It is best to get ahead of these concerns, as well as increase the safety of your home, rather than at the last minute, or before it's too late...
The standard solution to having one of these panels is a full replacement with a time-tested brand, such as Eaton or Siemens.
Need more capacity, but don't want to upgrade your main panel, or do you need additional capacity in just one location? Add a subpanel to support that location. Subpanels can be a great alternative to whole-house upgrades, and can make for a tidier electrical system and easier future additions.
Some customers prefer to DIY for their outlets in garages or sheds, but want a proper electrical contractor to perform the main job of bringing power out to that location and building in a new subpanel. This is a fine way to save money yet ensure that the important work is done properly.
Whatever your reasons, let me help you upgrade your home's panels knowing it is done right by an experienced professional.

5-Year Warranty on All Work
Every job I do is covered by a 5-year warranty on all labor, workmanship, and parts installed.
Additionally, I always work with 100% satisfaction guaranteed. If there is anything you are unhappy with, I will fix it and make it right for you!