The correct understanding of the nature and dynamics of interatomic magnetic interactions in solids is fundamentally important. In addition to that it allows to address and solve many practical questions such as stability of equilibrium magnetic structures, designing of magnetic phase diagrams, the low-temperature spin dynamics, etc. The magnetic transition temperature is also related with the behavior of interatomic magnetic interactions. One of the most interesting classes of magnetic compounds, which exhibits the rich variety of the above-mentioned properties in the transition-metal oxides. There is no doubts that all these properties are related with details of the electronic structure. In the spin-density-functional theory (SDFT), underlying many modern first-principles electronic structure methods, there is a certain number of fundamental theorems, which in principles provides a solid theoretical basis for the analysis of the interatomic magnetic interactions. One of them is the magnetic force theorem, which connects the total energy change with the change of single-particle energies obtained from solution of the KohnSham equations for the ground state. The basic problem is that in practical implementations SDFT is always supplemented with additional approximations, such as local-spin-density approximation (LSDA), LSDA + Hubbard U , etc., which are not always adequate for the transition-metal oxides. Therefore, there is not perfect methods, and the electronic structure we typically have to deal with is always approximate. The main purpose of this article, is to show how this, sometimes very limited information about the electronic structure extracted from the conventional calculations can be used for the solution of several practical questions, accumulated in the field of magnetism of the transition-metal oxides. This point will be illustrated for colossal-magnetoresistive manganites, double perovskites, and magnetic pyrochlores. We will review both successes and traps existing in the first-principle electronic structure calculations, and make connections with the models which capture the basic physics of the considered compounds. Particularly, we will show what kind of problems can be solved by adding the Hubbard U term on the top of the LSDA description. It is by no means a panacea from all existing problems of LSDA, and one should clearly distinguish the cases when U is indeed indispensable, play a minor role, or may even lead to the systematic error.