When Pope John Paul II visited the White House yesterday, he was accompanied by an entourage headed by the man whose power in the Catholic hierarchy is second only to his own: Vatican Secretary of State Agostino Caseroli.

Caseroli, a frail-looking man of 64, who has accompanied the pontiff throughout the trip here and in Ireland is credited by some authorities with having had a major influence on the extraordinarily successful speeches the pope has delivered during his American journey.

Like other prominent figures in the Roman Curia, Caseroli keeps a low profile and is rarely interviewed. From stories in the National Catholic Reporter, other publications and Vatican press releases, a picture emerges of a skilled diplomat whose rise in the Vatican hierarchy was steady and methodical.

"Promotion to the rank of under secretary came by the natural process of growing older," he once said in a jibe at himself.

Modesty notwithstanding. Caseroli earned his reputation as a skilled diplomat through years of negotiating with eastern European communist countries whose policies are doctrinally antireligious. Under a policy initiated by Pope John XXIII in the 1960s, the Holy See undertook to negotiate with communist bloc countries for greater recognition of the church and lessening of restrictions placed on it.

Over the years, Caseroli established diplomatic relations with Cuba in 1974 after an interruption of 13 years, and convinced the government in Hungary to allow the appointment of new bishops to dioceses that had been vacant for years.

Students of Vatican politics note that the then Rev. Karol Wojtyla's elevation to cardinal in 1967 came after a year in which Caseroli made several trips to Poland to negotiate with the government there.

Although Caseroli was viewed as a natural successor to French Cardinal Jean Villot, who died last March and under whom Caseroli was a key figure, he has been criticized in the past by conservative bishops who do not approve of the policy of negotiating with communist countries. These critics , who fear that too many concessions will be made to totalitarian governments, are currently in the minority.

Born near Milan in November 1914, Caseroli is the son of a tailor in a family that produced two other clerics, including an uncle who became a bishop.

Ordained in 1937, he studied at the Vatican's school for diplomats, the Academia Ecclesiastica. From then on he was involved in diplomacy, although his health was considered too frail for a foreign posting. He is conversant in six languages.

He is thought to have one of the best minds in the Vatican bureaucracy, and that bureaucracy, known as the Roman Curia, centered in Vatican City. has grown from a small group of cardinals in the 12th century to a top-heavy collection of departments, commissions, courts and congregations.

For many years, Caseroli's major outside interest has been his involvement with a home for delinquent boys in Rome. He has gone camping with them in the summer, advises them and on occasion has interceded on their behalf in the courts.