Structure and formation of deeply bound pionic atoms