IN TERMS OF constant and pervasive impact on the quality of national life, Mexico is for the United States the most important country in the world. This is the result of the massive and unending flow of people and goods across the 2,000-mile border, and of the interdependence of the two countries' economies, cultures and overall destinies. Yet on the American side, the Mexican connection has been largely perceived as a lesser, regional concern. Only recently has it come to be seen as one requiring the direct and sustained attention of the national political community.

Two factors account for much of this change. One is the growth, and the growing American awareness, of emigration -- most of it illegal and adding perhaps 1 million or 2 million persons a year to the American population. The other is Mexico's discovery of fabulous oil reserves, even as the United States hungers for new, reliable and readily available energy supplies. Their net effect is suddenly to give Mexico the means to focus the American people and government on a relationship that, Mexicans feel, Americans have neglected far too long.

This is the context in which President Carter begins a visit to Mexico today. There seems to be, on both sides of the border, a sense that the two nations' presidents are meeting as equals perhaps for the first time, and that they will set not only the agenda but also the tone of Mexican-American relations for a long time to come. There is a further sense that particular issues, such as energy, immigration and trade, can no longer be handed over to lieutenants for narrow solutions, as the Mexican gas issue has been handled, but must be treated according to a broad pattern shaped at the highest political level.

This will require a long and difficult mutual political education. Mexicans cannot expect the United States to absorb their exports of labor and goods without limit, and to sit by contentedly while Mexico husbands its oil. Americans cannot expect Mexico to let the border be closed to migrants and open to expanding oil exports, while the United States tosses in token development aid and trade concessions.

The process may also require, on the American side, a new governmental structure. Relations with Mexico not only cut across departmental and functional lines at the federal level; they also touch and cut across lines at the state and local levels, especially along the border. Some new mechanism must be found. The search has already begun, and Mr. Carter, in addition to exploring new avenues of substantive policy, should spur it on.