How the Barcelona Pavilion, a landmark in modern interior and exterior architecture, came to be is a good story. As with the best works of art, its success was due half to accident, half to inspiration

Ludwig Glaeser, to celebrate the 50th anniversary of the pavillion, tells the story in an exhibit opening to the public today in the National Gallery of Art's East Building. Glaeser is curator of the Mies van der Rohe Archive of the Museum of Modern Art in New York.

In 1929, Ludwig Mies van der Rhoe, a German architect, was known for his projects yet to be built. He was asked by the Weimar Republic to oversee the participation of German industries in the International Exposition at Barcelona, Spain, to be held in the summer and fall of that year. He said fine; and his mistress, the desingner Lilly Reich, was named artistic director.

"Mies was the sort of person who needed a year to think things over and another year to do them," Glaeser said the other day, as he installed the show. Mies was undoubtedly disturbed when, six months before the exposition was to open, the German government found that other countries were putting up national pavilions, not just individual display areas for industries. Worse still, Spain's King Alfonso XIII and his queen, Victoria Eugenie (whose reign almost didn't outlast the pavilion), were supposed to come and sign their names in a golden book.

Mies set to work to design almost overnight a building grand enough to welcome a king and republican enough to represent Germany's new people's government. Glaeser recalls that Mies had been the former president of the Novembergruppe, named for the German revolution of 1918.

The pavilion -- "What's a pavilion?" Mies reportedly asked -- was designed for the one-time-only ceremony and the ritual function of showing the flag. The design was in the tradition of Mies' hometown, Aachen, the Charlemagnian city of great vernacular medieval architecture, suggests Glaeser. In his catalogue for an earlier exhibit on furniture by Mies and Lilly Reich's furniture at the Museum of Modern Art two years ago, Glaeser discussed the Barcelona charis and tables, both based on the X form: g

"For this symbolic act [the signing of the book], Meis designed the table which was placed against the onyx wall and which, like an altar, identified the ritual center. A second and larger table in front of the light wall must have served a more profane purpose, the deployment of chanpagne bottles and glasses.

"There were only two Barcelona chairs, which, placed at right angles to the onyx wall, faced the entrance across the length of the room. All other seats were ottomans, placed at a respectful distance along the glass walls on either side of the room."

In pictures existing of the pavilion, there seem to be many ottomans, but Glaeser suspects that the six ottomans were moved around by the photographer. Glaeser also is sure that a row of tubular steel charis were hauled out of the office for the picture. As Glaeser says in the brochure accompanying the exhibition (regrettably lacking a catalogue), "Seldom has so much been written on the basis of so few facts . . . . What is known comes from 14 photographs, one not quite accurate plan drawn for publication, and a few not very detailed reviews."

The pavilion itself was built in two months. Mies liked to tell the story that the ceiling height came about because of the onyx block.

In Hamburg, looking for materials, Mies found a raw African block of onyx. Glaeser said it was to be made into two ornamental vases for an ocean liner's dining lounge. Meis walked up to it and took a sample with one perfect strike of a mallet. He liked it so much he bought the marble on the spot, out of his own pocket -- and spent the train trip to Berlin worring whether the pavilion would actually be built.

As a young man, Meis had worked as a stonemason. Glaeser said Mies bragged he could draw the standard ornamentation standing with his back to the paper. The exhibit's great glory is a fine pastel drawing of a concrete country house project of 1923, and several fine courthouse sketches, all by the master's hand.

Ironically, because only black-and white photographs of the pavilion are available, a mystique has grown up based on the lack of color. Actually, as Glaeser shows, the onyx was gold, the adjacent curtain was red and the carpet on the floor was black -- the colors of the German Republic. $ barcelona chairs, designed first for the pavilion, in our generation have become ubiquitous in all modern posh interiors. (The East Building is full of them, despite their $2,750 retail price. The chairs are still in production by Knoll International, which gave a grant for the current show.) The chairs are almost always seen in natural-colored leather. At their first apperance, in the pavilion, they were white kid. In the National Gallery show are a Barcelona chair and ottoman lent by architect Philip Johnson, who bought them in the 1930s.

The elaborate model, prepared by Mies' old firm in Chicago (where he worked after coming to the United States as a refugee), will go a long way to help straighten out our ideas of just how the pavilion was put together. The sketches of Mies courthouses, both built and unbuilt, show their kinship. t

The pavilion itself lends much the same feeling as the Tugendhat house, which Mies was working on at the same time.

In our day, the pavilion has become almost the sacred center of the International style of architecture.In the United States, Mies' Farnsworth House was in the tradition. And Philip Johnson, once a Mies disciple, built what may well be the ultimate pavilion -- his own glass house in New Canaan, Conn.

All architecture is either a pavilion in the woods or a cave in the mountains. Today, when we are thinking of going back to the cave, because of energy costs, it's good to see how splendid the pavilion can be.