The winner of a recent "What Does the King Mean to You" nationwide art competition for schoolchildren was an 11-year-old from Madrid who chose to represent Juan Carlos by drawing a map of Spain cut in two by a chasm and held together by a series of tightly stretched bandaids. A runner-up was an entry from a nine-year-old in a small farming village who sketched a shepherd wearing a crown and leading a flock of 17 white sheep and three black ones.

The children intuitively had homed in on what has become the monarch's crucial role in the nation. Juan Carlos, who arrived in Washington today with Queen Sofia, has become essential to Spain and Spaniards.

During his two-day visit to Washington, the king is scheduled to meet with President Reagan at the White House and with Secretary of State Alexander M. Haig Jr., Commerce Secretary Malcolm Baldrige and members of Congress. He will also make an appearance at the Organization of American States and attend a reception to open an exhibit called "Spanish Art Tomorrow" at the Corcoran Gallery of Art on Wednesday.

It is because the king, like the bandaids, holds the nation together, and because there are some black sheep that Spain's secretary of state for internal security confessed at a press lunch last week that his department is concerned about Juan Carlos' security.

The king could be a target of extreme rightists who -- correctly -- judge that the monarch is the principal barrier to a return to a Franco-style dictatorship or of Basque separatist terrorists who believe that their Marxist platform will take root in the kind of military rule the rightists seek. Security officers have to put up with the king's outgoing personality and the manner in which he relishes being available to crowds.

The security chief, Francisco Laina, is well placed to assess the king's role and importance, since on Feb. 23, during the coup attempt in Spain, Juan Carlos ordered him to form a provisional government composed of senior administration officials while the government and parliament were being held hostage by rebels in the parliament building. That interim executive provided the continuity of the constitutional order in the midst of the confusion.

The Washington trip comes nine months after it was originally planned. Juan Carlos and Sofia postponed their trip last January when the prime minister, Adolfo Suarez, abruptly resigned, causing a political vacuum that culminated in February's coup attempt. Had both the plotters and the royal couple kept to their schedules, Juan Carlos would have been visiting the West Coast as part of a more extended U.S. tour when the shooting started in the Congress of Deputies.

The 42-year-old king's call to discipline to the armed forces ended the putsch. In the months since the trip was first planned, Juan Carlos' prestige has grown dramatically -- to the point where he now exercises strong leadership in a country that traditionally has never been enamored of the monarchy. The key to his leadership lies, according to Spanish analysts, in Juan Carlos' defense of the constitutional order.

A weighty study of Spain's transition from dictatorship to democracy was published in August by a respected Spanish independent foundation, Foessa. It concluded that as early as 1978, when democracy was still fragile three years after Franco's death, a majority of Spaniards already acknowledged and approved Juan Carlos' role as the prime mover behind the changeover to a free, Western political society.

Concluding their chapter on the king and his popular acceptance, the authors of the study pointed out that his main legitimacy derives not from the fact that he is a member of the Spanish royal family, nor from his designation by Gen. Francisco Franco to succeed him, but from Juan Carlos' espousal of and identification with the new Spanish democracy.

The study showed that by 1978 the young monarch was backed to a greater extent by anti-Francoists than he was by moderate Francoists who saw that their political system needed an overhaul. Both groups taken together gave Juan Carlos a clear endorsement to break with the past. The evidence that he lived up to his commitments in February is the basis for the esteem he now enjoys.

Spaniards, who have a long memory for their own, usually violent history, recall that February marked the first time that a Bourbon monarch in Spain, faced with the choice of civil and military power, freely chose the first.

The idea of a new monarchy, healing the wounds of the past, is a popular one in Spain, and Juan Carlos asserts the image of modernity, youth and tolerance.