In this overview we examine the basic principles of properties of electroencephalogram and magnetoencephalogram and the corresponding models of sources and of the volume conductor. In particular we show how the dipolar model is anchored in neurophysiological findings and how the different conductivities of the brain and the tissue surrounding it can be estimated. Using these basic models as tools we show how the functional localization of the neural sources of rhythmic activities (alpha and mu rhythms and sleep spindles) and of epileptiform activities can be estimated and integrated with structural data of the brain obtained with MRI.