Fixed electric rates from retail electric companies are not always more expensive than shorter term electric rates.
On rare occasions a short term fixed rate, like 6 months, will be more expensive than a 2 year rate.
In the situation where long term fixed electricity rates are more expensive than short term prices it is because the futures market speculates that prices will be higher in the long term.
People who lock in to a long term fixed price at a higher price than a 6 month price are doing so because they expect prices to be higher 6 months from now.
When a 6 month fixed electric rate is in the rare situation of being higher than a 2 year fixed price it is because prices are expected to be lower in the short term.
The 2 year price may look super cheap compared to a 6 month price but 6 months from then, when rates drop significantly, many people who locked in long term will be hating themselves.
Think of long term contracts as insurance. If you think energy commodities will be steadily increasing in price over the long term you would be good to go with a longer contract.
With anything regarding looking into the future no one really has the answer and even experts guess wrong. If you were to go with a long term commitment and prices dropped significantly soon after committing you can always blend your contract with an updated price and get an average of the two.
In summary there are always ways out of a longer term energy contract so if you have a good hunch that prices will be higher in the next year or two it may be a good idea to commit. The worst case scenario would be to have to blend that contract in with a much lower rate if prices drop and accept an average price of the two or just cancel the contract, pay the penalty, and renew at a cheaper price.