In a realignment of priorities, the National Endowment for the Humanities will give to 13 independent research libraries $5.3 million left over from grant programs that were designed, among other things, to increase public understanding of the humanities through displays in the media and museums.

Under the new program, the Folger Shakespeare Library here will receive $500,000 to complete a building renovation project and the Virginia Historical Society $100,000 to install a climate control system in its book stack area. Each grant is to be matched by private donations three times the amount of the grant.

"This signals our interest in a time of appropriate budget reductions in focusing on essential resources, institutions that are the generators for some of the most important work in the humanities," said NEA Chairman William J. Bennett in a telephone interview.

Bennett said more grant money was now going into research and "special initiative projects" such as the library grants "and less into the divisions of public education , media and museums."

According to NEH statistics, the endowment last year slashed general program grants by 48 percent to a total of $15.4 million although the number of applications in that division had increased by 2 percent, and cut education grants by 31 percent to a total of $11.5 million while the number of applications had dropped only 13 percent.

Endowment officials said the cuts were made because there were fewer high-quality applications than anticipated.

Last year the endowment returned $834,000 to the U.S. Treasury that it didn't need for administration. "We like to think it testifies to Bill Bennett's good administrative sense of things," said Tom Kingston, director of the endowment's challenge grants program.

President Reagan met with Bennett and representatives of the 13 libraries in the Oval Office yesterday.

Other research libraries that will receive grants are the Huntington Library in San Marino, Calif., the Newberry Library in Chicago, the New York Public Library, the Pierpont Morgan Library in New York, and the libraries of the American Antiquarian Society in Worcester, Mass., American Philosophical Society in Philadelphia, the Historical Society of Pennsylvania, the Library Company of Philadelphia, the Massachusetts Historical Society, the New York Academy of Medicine and the New York Historical Society