The structure of exotic nuclei sheds new light on the linkage of the nuclear structure to the nucleonic interaction. The self-consistent mean-field (SCMF) theories are useful to investigate this linkage, which are applicable to many nuclei covering almost the whole range of the nuclear chart without artificial truncation of model space. For this purpose, it is desired to develop effective interaction for the SCMF calculations well connected to the bare nucleonic interaction. Focusing on ground-state properties, I show the results of SCMF calculations primarily with the Michigan-three-range-Yukawa (M3Y)-type semi-realistic interaction, M3Y-P6 and M3Y-P6a to be precise, and discuss in detail how the nucleonic interaction affects the structure of nuclei including those far off the [Formula: see text]-stability. The central channels of the effective interaction are examined by the properties of the infinite nuclear matter up to the spin dependence and the isospin dependence. While experimental information of the infinite matter is obtained by extrapolating systematic data on finite nuclei in principle, it is not easy to constrain the spin dependence and the isospin dependence without connection to the bare nucleonic interaction. The noncentral channels play important roles in the shell structure of the finite nuclei. The tensor force is demonstrated to affect [Formula: see text]- or [Formula: see text]-dependence of the shell structure and the magic numbers, on which the spin–isospin channel in the central force often acts cooperatively. By using the M3Y-P6 interaction, the prediction of magic numbers is given in a wide range of the nuclear chart, which is consistent with almost all the available data. In relation to the erosion of magic numbers in unstable nuclei, effects of the tensor force on the nuclear deformation are also argued, being opposite between nuclei at the [Formula: see text]- and the [Formula: see text]-closed magicities. Qualitatively consistent with the [Formula: see text]-force effect on the [Formula: see text]-splitting suggested from the chiral effective field theory, the density-dependent LS channel, which is newly introduced in M3Y-P6a, reproduces the observed kinks in the differential charge radii at the [Formula: see text]-closed magic numbers and predicts anti-kinks at the [Formula: see text]-closed magic numbers. The pairing correlation has significant effects on the halos near the neutron drip line. A new mechanism called “unpaired-particle haloing” is disclosed.