The 75-year-old running battle between Virginia's cities and counties over annexation came closer to a peaceful conclusion yesterday when the House of Delegates, by wide margains, passed two important compromise bills.

One bill gives urbanized counties like Fairfax. Arlington and Prince William total immunity from annexation attempts by neighboring cities, while like other gives independent cities like Alexandria a bigger share of state road funds.

A third bill, which would funnel from $150 million to $200 million in state aid to cities over the next four years, is being considered by the House Appropriations Committee. Del. Thomas J. Michie, Jr. (D-Charlottesville), who sponsored it, along with the other two with a touch of gallows humor, said, "If it doesn't pass, I'll commit suicide."

But Michie noted that the bill is cosponsored by 12 delegates on the 20 member Appropriations Committee, including its chairman.

The bill that would bring urbanized counties permanent protection from annexation passed yesterday 77 to 20. Another version passed the House last year by a narrower margin, 63 to 31, and was defeated in the Senate by two votes.

To make the bill more palatable this year to legislators from urban counties, Michie elminated a controversial section that would have permitted cities and counties to share tax revenues from growth. To get the city legislators to go along, Michie drew up new funding formulas that will provide more state aid to cities for roads, law enforcement, judical administration, health, mental health and mental retardation and welfare.

As a result, Michie said he is more optimistic that his bills will pass the Senate this year.

In the past, cities have clung to their rights to seek annexation of adjoining, and richer, counties because, they maintained, there was no other solution to their dilemma: a tax base that was shrinking as the need for service was rising.

Actual attempts at annexation - Alexandrial has tried, successfully and unsuccessfully in the past, to bite off pieces of Fairfax and the threat of such attempt have often posioned relations among neighboring localities.

In what became for the Michie bills an important act of reconciliation, the Virginia Municipal League - which represents cities - and the Virginia Association of Counties put forward a common annexation proposal earlier this month.

Key elements of the compromise are in one or another of the Michie bills.

One element that ws struck from Michie's annexation bill in a House committee was a paragraph that would have prohibited any unincorporated area in a county - such as Reston in FairFax County - from becoming a town after Jan. 1, 1980.

While it is known as a "new town," that designation gives Reston no legal standing. The paragraph was deleted at the urging of Del. Raymond E. Vickery Jr. (D-Fairfax), who said he thinks that identifiable communities should be able to incorporate as towns or a new governmental classification called townships.

Vickery won another victory yesterday when the House passed his joint resolution calling for House and Senate Committees to study the possibility of establishing smaller units of government within large, urbanizing counties.Smaller government units may, the bill says, assure "economic efficiency (and) recognition of the values inherent in a sense of community identity."

Under a bill that passed last year but has to re-enacted in 1979 for it to take effect, Reston would be able to become a town. Towns are not independent, like cities, but they do have partial taxing power and are governed, to a limited extend, by a council, mayor and town manager.

The Michie annexation bill, besides offering urban counties protection from annexation, also makes it harder for towns within counties to become independent cities.Fairfax County with one independent city in its midst - Fairfax City - has been concerned about present towns in its midst, such as Vienna and Herndon, becoming cities.

But there are carrots for towns too. A petition to annex part of a county can be filed by 51 percent of the qualified voters or real estate owners in the affected area of a town. The same applies for city voters or property owners. There is also provision for towns to annex county territory if they give up the right to become independent cities.

To help head off disputes between localities, which are bound to develop even if all the Michie bills are enacted, one measure calls for the creaction of a state Commission on Local Government. The commission would be charged with settling minor boundary disputes and, more important, submitting a fact-finding report to any court that gets an annexation dispute or other issue involving rivalries between localities.