Granted, there isn’t really a distinction between “shall” and “will” in Modern English, other than a vague sense that “shall” is more formal. Yet I’ve wondered about their difference, and I’m sure I’m not the only one. If nothing else, why would we need a more formal version of “will”?
The words have different origins; “shall” comes from roots meaning “necessity” and “will” from “wish.” It makes sense, then, to have verbs that effectively mean the same thing but with different flavors. I shall do it because I have to; I will do it because I wish to.
For a time, some grammarians suggested that “shall” be used when discussing the future and “will” for any other time. “I will do it” = I will do it right now. “I shall do it” = I will do it in the future.
Other grammarians suggest “shall” is for first person (I shall, we shall) and “will” for second and third (you will, they will).
These days, “shall” tends to sound pretentious. A writer does not have to follow any of the above rules for shall and will, since those are barely rules to begin with. As always, consider the audience: what makes the most sense for them?