Discharging all energy of one battery into another
The way lithium-ion batteries work is by being at full charge at ~4.2V and "no charge" at ~3.0V. The limits on voltage is due to safety, because lithium-ion batteries are unstable outside of this range. 

So given this information, and we know from electronics that the higher voltage-potential is the one that will control the way the energy flows, we can see that you would want the "charger battery" to stay at a higher voltage than 4.2V. Of course you aren't going to charge it to a higher voltage, but you can step up the voltage with a buck-boost converter, also called a step-up regulator. Then you could have the voltage at for example 5V, and it would charge the other battery.

If you want to charge the other way again, for whatever reason, then you can use the same step-up regulator and some switching-circuitry with mosfets to control which battery that is stepped up to 5V.

I have drawn a suggested schematic below. You want to research this more of course, but I think this would be at least close to what you want.







simulate this circuit &ndash; Schematic created using CircuitLab

My schematic does not include over-charge and under-charge protection. This is of course an important aspect you need to add to ensure you don't charge above 4.2V. That part of the design is up to you to include, but should be simple enough.

Sidenote: 3.7V stated on the batteries in the schematic is because this is the nominal voltage of lithium-ion batteries. They will charge up to 4.2V and discharge as much as you allow it.