We report on a first-principles investigation of the electronic structure and of the magnetic properties of the quasi-two-dimensional Mott insulator SrCu2(BO3)(2). Based on the hopping integrals and Coulomb interactions calculated with local-density approximation and local spin density approximation taking into account the on-site Coulomb correlations (LSDA+U), we provide a microscopic explanation of the symmetric Heisenberg and antisymmetric Dzyaloshinskii-Moriya exchange integrals of SrCu2(BO3)(2). The intra-atomic exchange interaction of oxygen is shown to strongly contribute to the intradimer isotropic exchange. The results are in good agreement with those derived from experimental data, both regarding the orientation of the Dzyaloshinskii-Moriya vectors and the magnitude of all exchange integrals. The microscopic analysis is confirmed by the results of Green's function and total energies difference methods.