Recent thermal runaways in lithium-ion batteries have reinforced the focus on the research of safer electrolytes based on ionic liquids. A simple switch from organic solvents to ionic liquids has been proven difficult due to the decreased efficiency of batteries caused by decreased conductivity and increased viscosity of ionic liquids upon addition of lithium salts. The new trend in replacing lithium salts with a cheaper alternative, sodium salts, has resulted in rather poor solubility of sodium salts in commonly used ionic liquids. This phenomenon has been left largely unexplained. Herein, we present a high-level quantum chemical study of the chemical bonding of lithium and sodium salts coupled with ionic liquid anions. Due to their proximity to the anion, the 1s2 electrons on the lithium cation are found to become strongly polarized by the presence of the anion such that they start participating in the bonding, making it more covalent than originally thought. In sodium salts the 2s2 orbitals are rather removed from the anion, making its influence weaker. This polarization results in 90 kJ mol-1 of difference in the interaction magnitude between lithium and sodium salts. Theoretical results have confirmed that increasing covalency in lithium salts results in their excellent solubility since these dissolve as ion-paired complexes. The downside of this ability is decreased conductivity as lithium salts are unlikely to easily dissociate in ionic liquids. Sodium salts are shown to maintain a high degree of ionicity, thus decreasing their chances of being solvated by ionic liquids as a result of their low concentration of ions per unit volume. The theoretical results are further underpinned by solubility studies of MX salts, where M = Li or Na and X = bis(trifluoromethylsulfonyl)imide (NTf2), BF4 - or PF6 -, conducted in six different ionic liquids. Lithium salts consisting of BF4 - or PF6 - exhibited significantly better solubility than their sodium analogues by at least an order of magnitude. The findings of this work will have implications on the future direction of the development of safe electrolytes for lithium and sodium-ion secondary batteries.