Sources of anisotropy in rare earth and actinide exchange interactions