The Spanish government was aware that a coup was coming and had taken steps against it, though these precautions would prove inadequate. Still, the coup would likely have failed without intervention from Germany and Italy.
King Alfonso XIII fled Spain in 1931 following the declaration of the Second Spanish Republic. But monarchists, the Catholic Church, and other right-wing forces in Spain were not ready to submit.
King George V died in January 1936, leaving the crown to his eldest son, who became Edward VIII. But Edward just didn't seem to take his responsibilities seriously.