Energy in capacitors - loss?
I agree with Steven, but here is another way to think about this problem.
Suppose we had two nice and perfect 1 F capacitor. These have no internal resistance, no leakage, etc. If one cap is charged to 1 V and the other at 0 V, then it's hard to see what really happens if they were connected because the current would go infinite.
Instead, let's connect them with a inductor. Let this be another ideal perfect part with no resistance. Now everything behaves nicely and can be calculated. Initially, the 1 V difference starts current flowing in the inductor. This current will increase until the two caps reach the same voltage, which is 1/2 V. Now you've got 1/8 J in one cap and 1/8 J in the other cap for a total of 1/4 J as you said. However, now we can see where the extra energy went. The inductor current is maximum at this point, and the remaining 1/4 J is stored in the inductor.
If we kept everything connected, energy would slosh back and forth between the two caps and the inductor forever. The inductor acts like a flywheel for current. When the caps reach equal voltage, the inductor current is at its maximum. The inductor current will continue, but now will decrease due to reverse voltage accross it. The current will continue until the first cap is at 0 V and the second at 1 V. At that point, all the energy has been transferred to the second cap and none is in the first cap or the inductor. Now we are at the same point we started at except that the caps are reversed. Hopefully you can see that the 1/2 J of energy will continue to slosh back and forth forever with the cap voltages and the inductor current being sine waves. At any one point, the energies of the two caps and the inductor add to the 1/2 J we started with. Energy is not lost, just constantly moved around.
Added:
This is to more directly answer your original question. Suppose you connected the two caps with a resistor in between. The voltage on both caps will be a exponential decay towards the 1/2 V steady state as before. However, there was current thru the resistor which heated it. Obviously you can't use some of the original energy to heat the resistor and end up with the same amount.
To explain this in terms of Russell's water tank analogy, instead of opening a valve between the two tanks you could put a small turbine in line. You can extract energy from that turbine as it is driven by the water flowing between the two tanks. Obviously that means the end state of the two tanks can't contain as much energy as the initial state since some was extracted as work via the turbine.
You moved energy from one place to another and you can't do that unpunished. If you connected the two capacitors via a resistor the 0.25J went as heat in the resistor. If you just shorted the caps together much of the energy will have radiated in the spark, the rest again is lost as heat in the internal resistances of the capacitors.
further reading
Energy loss in charging a capacitor
The transfer is lossy - whether by \$I^2R\$ drop in the connecting circuit or electromagnetic energy radiation or spark or other coupling. That this is so is shown a priori by the fact that you know what the end result must be (\$V/2\$ each) and that this must result in an energy decrease using any "normal" connecting method. If you use near perfect wire you get near infinite currents. Every time you have the wire resistance you get double the current and losses increase linearly with decreasing resistance (decrease with \$R\$, increase with \$I^2\$).
You can get a different result using an "abnormal" method.
If you use an ideal buck converter it will take Vin x Iin at the input and convert it to the "correct" Vout x Iout at the output to allow no resistive or other losses. The result is easily determined but non intuitive. Making the buck converter non-ideal can give you a result in the 95% - 99% of theoretical range.
As we have 0.5 Joule in a 2 Farad capacitor at the end of the process we know that
$$ U = 0.5 C V^2 $$
$$ 0.5 = 0.5 \times 2 \times V^2 $$
$$ V = \sqrt{0.5} - 0.7071 V $$
We can try that again using just one of the capacitors. As we have 0.5 J initially we get 0.25 J in one cap at the end.
$$ 0.25 = 0.5 \times 1 \times V^2 $$ $$ V = \sqrt{0.5} = 0.7071 V $$
Same result, as expected.
At first glance I thought the water tank analogy was wrong in this case, but it also works quite well for part of the problem. The difference is that, while we can model the lossy case well enough, the loss free case does not make sense physically.
ie A 10,000 litre tank 4 metres tall has energy of 0.5mgh.
h is average height = 2 metres.
Lets's have g=10 (MASCON nearby :-) ).
1 litre weighs 1 kg.
$$ E = 0.5mgh = 0.5 \times 10000 \times 10 \times 2 = 100 kJ $$
Now siphon half the water into a second identical tank.
New depth = 2m. New average depth = 1 m. New content = 5000 litre
Per tank energy = 0.5mgh = 0.5 x 5000 x 10 x 1 = 25,000 Joule
Energy in 2 tanks = 2 x 25 000 J = 50 kJ.
Half of our energy has gone missing.
With a "water buck converter" each tank would be 70.71% full and we'd have made more water.
On this aspect the model fails.
Unfortunately :-).