We present a first-principles study based on plane-wave derived Löwdin population analysis and other local bonding descriptors to investigate cathode and anode materials for lithium and sodium ion batteries, with a special emphasis on complex nitrogen chemistry. By comparing the Löwdin charges of commonly used electrode materials to other phases such as salts of dicyanamide and nanoporous carbon-based compounds, new conclusions of an improved intercalation behavior of the latter are derived. In addition, we explore the stability of the dicyanamide salts upon Li and Na removal, some of them resulting in dimerized structures. In particular, having a look at the different kinds of bonds and the corresponding covalency indicators reveals insights into the bonding changes during dimerization. Considering the astonishing thermal stability of metal dicyanamide salts, which are solid at room temperature, their electrochemical activity as well as non toxicity of alkali metal-based compounds, these materials are potential alternatives to commercially available electrodes, particularly as they show some flexibility in exhibiting anodic and cathodic behavior and allow for transition metal-free cathode materials.