Emerging intrinsic magnetism in two-dimensional materials: theory and applications