major - means of great stature, or importance, but not necessarily the most important
main - means the most important element, but can mean other things as well. It may also mean something that stands alone.
primary - means the most important element, but can mean other things as well. It might mean the first or the essential part.
There may be no difference between main and primary, depending on how they are used.