Transformation of polarons to bipolarons in disordered matter