Theory and applications of atomic and ionic polarizabilities