JEE Main and JEE Advanced are two connected stages of the engineering entrance path, where JEE Main is the first, larger exam and JEE Advanced is the tougher second exam that leads specifically to the IITs.
JEE Main is the entry level national exam. It is used for admission to NITs, IIITs, and many other engineering colleges, and it is also the qualifying exam you must clear to become eligible for JEE Advanced. A very large number of students appear for it.
JEE Advanced is the more difficult exam taken only by the top scorers of JEE Main. It is used specifically for admission to the Indian Institutes of Technology, the IITs, which are the most sought after engineering institutions in the country.
So the relationship is simple. You first clear JEE Main, and if you rank high enough, you qualify to attempt JEE Advanced for a shot at the IITs. JEE Advanced tests deeper conceptual understanding and problem solving, while JEE Main is more direct and speed based.
Both cover Physics, Chemistry, and Mathematics, but Advanced questions are more challenging and application heavy.
Example: A student cleared JEE Main and got into a good NIT, while his friend who also cleared Advanced with a strong rank secured a seat at an IIT.
One practical tip: Build strong fundamentals from Class 11 itself, because JEE Advanced rewards deep conceptual clarity that cannot be built through last minute cramming.