The National Guard are actually state militias that can be federalized by order of the President. When federalized, they fall under the authority of the Army and are treated as Army units (except the Air National Guard which is the air force of the state militias and are under the authority of the Air Force when federalized).
The Marine Corps is "naval infantry". They are the ground based warfare arm of the Department of the Navy, but are a separate branch from the Navy itself. The Marine Corps mission focuses on mobility and rapid deployment. As they were traditionally deployed to Naval ships, they were the most mobile groundforce prior to the advent of the airplane. Even with the airplane, a large fighting force can be deployed anywhere in the world that a Naval vessel can get within spitting distance of.
The National Guard, is basically an extension of the Army. When you enlist in the National Guard you are federalized and assigned to an Army training unit for your Basic Training and then assigned to a different one for you Advanced Individual Training. Following your training, you are transferred back to your state National Guard Unit. The National Guard (unless federalized) falls under the authority of the governor of the state in question. This is why they are often called up for local natural disasters and other local civil missions. As a National Guardsman, after your initial training during which you serve full time, you will serve one weekend a month and an additional two weeks every year (unless called up by the governor or President in which case you serve full time until they decide otherwise). Those weekends and two weeks of service can be spent doing anything from training, playing wargames, learning new equipment, cleaning the latrine, fixing things, etc...
The Marine Corps is purely federal and you serve full-time unless you are in the Marine Corps Reserve. If you are Marine Corps Reserve, you have a similar schedule of one weekend a month and two weeks a year. The difference is that you will serve those weekends and two weeks at Marine Corps facilities rather than at the state National Guard facilities. You also never all under the authority of a state governor.
The National Guard's mission is not to repel invaders (though that is certainly a use that they can be called up for). Their mission is the serve their state and, if federalized, their nation in whatever capacity they are ordered to. This means disaster relief, or being called up and sent to Iraq in a federal capacity to supplement the regular Army, or being called up to go on humanitarian missions to provide food/aid/medicine to underdeveloped countries, or being called up to repel an invasion.
Does this help?