So this is a little bit of a "which came first - the chicken or the egg" issue because by the time of the Vietnam War those two "fronts" (the battlefield and the home front) have become very much linked.
The short version has me leaning towards the latter answer. During the peace talks, Major General Douglas Kinnard commented to one of his North Vietnamese counterparts:
(paraphrasing) "You know you never defeated us on the field of battle." The North Vietnamese delegate pondered that for a second and responded, "That may be true, but it is also irrelevant." Douglas Kinnard, The War Managers
Up until the Tet Offensive at the end of January, 1968, public support for the war effort remained relatively high, the perception remained that progress was being made in South Vietnam, reinforced by a speech made to a joint session of Congress by the commander of the MACV (Military Assistance Command, Vietnam) General William C. Westmoreland in November of 1967 which cited over a page and a half of quantitative analysis showing growing security and success in South Vietnam. Gareth Porter, Vietnam: A History in Documents
Tet pretty much blew up that perception. The scale, ferocity, and (temporary) success of the offensive shattered the perception back in the states that the war was being won. This is despite the fact that Tet ended up being a major tactical defeat for the North Vietnamese Army and virtually destroyed the fighting capacity of the Viet Cong guerrillas in the South. More important for people back home was the sight of attackers inside the very grounds of the US embassy in Saigon, and images of South Vietnamese authorities executing captured guerrillas on the spot.
Tet effectively sealed the fate of the American intervention in Vietnam. It played a major role in President Johnson deciding not to run for reelection in '68 and in President Nixon's decision to pursue "Vietnamization" and the gradual drawdown of American presence within South Vietnam.
A more nuanced answer, however, brings the battlefields back into play. Vietnam was an extremely political war. By that I mean that the geo-political realities of the time affected not only the war goals of America in Vietnam, but also the strategy (If you need a more in-depth explanation of the different levels of military-political planning I would be happy to provide one in a follow-up comment). This was in stark contrast to previous American military thought and experience. For example, during WWII the overriding emphasis was to win the war, the how aspect was largely left to the military and the Generals. In Vietnam, however, American commanders were hamstrung in their prosecution of the war by political realities (mostly the threat of Soviet or Chinese intervention) that prevented them from carrying out a large-scale invasion of North Vietnam or effectively cutting the Ho Chi Minh Trail in Laos.
In addition, domestic political opposition also made President Johnson unwilling to call up the national guard and army reserve units, or to place the country on a war-footing (a move that would have required sacrifices to his beloved Great Society domestic program). This placed a strain on the military's troop levels in Vietnam. The Army was therefore entirely dependent upon volunteers and draft conscripts to fill its ranks, and commanders were constantly complaining that Washington had not given them enough men to fully complete the job.
All this forced American commanders to adopt a strategy of attrition within South Vietnam with a secondary emphasis on pacification and counterinsurgency, none of which the military was particularly well-suited to carry out at the time. Thomas Ricks, The Generals and Russell Weigley, The American Way of War.
Basically, the army tried to use conventional tactics, such as firepower, rapid mobility, and airpower, to fight a very unconventional war. North Vietnamese and Viet Cong forces almost always possessed the tactical initiative, choosing when and where to engage the technologically superior Americans. By doing so, the North Vietnamese were able to preserve their fighting units in the south and avoid units being annihilated by the overwhelming American advantage in firepower. Thus, the communists embraced the possibility of a very long war that would stalemate into a situation where the US was too strong to be directly defeated in battle, but also politically unable, or unwilling, to carry out the strategy necessary to eliminate the source of their struggles within the north. Eventually, America's commitment to South Vietnam would be exhausted, just as France's had been a decade before. Some major North Vietnamese officials including Vo Nguyen Giap, head of the North Vietnamese army, believed that the war could potentially take up to another 20 years, but that eventually the Americans would grow sick of the struggle and supporting the "puppet" regime in South Vietnam. Instead, the process took about 7 years (from the time when American troops were first deployed to South Vietnam in large numbers during the summer of 1965 until the peace agreement of 1972).
So, a strong argument could also be made that the inability of the American military to effectively bring the North Vietnamese and Viet Cong "main forces" to a decisive battle where they could be annihilated on American terms is what allowed the communists to turn the struggle into a war of attrition, facilitating the eventual collapse of support for the war on the American home front.