Phase change materials (PCMs) can be rapidly and reversibly switched between the amorphous and crystalline state. The structural transformation is accompanied by a significant change of optical and electronic properties rendering PCMs suitable for rewritable optical data storage and non-volatile electronic memories. The phase transformation is also accompanied by an increase of the Casimir force of 20 to 25% between gold and AIST (Ag5In5Sb60Te30) upon crystallization. Here the focus is on reproducing and understanding the observed change in Casimir force, which is shown to be related to a change of the dielectric function upon crystallization. The dielectric function changes in two separate frequency ranges: the increase of absorption in the visible range is due to resonance bonding, which is unique for the crystalline phase, while free carrier absorption is responsible for changes in the infrared regime. It is shown that free carriers contribute ≈50% to the force contrast, while the other half comes from resonance bonding. This helps to identify PCMs that maximize force contrast. Finally it is shown that if this concept of force control is to be employed in microelectromechanical devices, then protective capping layers of PCMs must be only a few nanometers thick to minimize reduction of the force contrast.