AgCN is covalent in nature so it does not dissociate in to Ag+ and CN− and on nitrogen electron density is high,and nitrogen is free to donate electron pair forming isocyanide or alkyl isonitrile as the main product.
R−X+AgCN→RNC+AgX
KCN is ionic in nature, so it dissociates completely.
R−X+KCN→RCN+KX
Hence the answer is D.