The following definition of Ampere's law is from Concepts of Physics by Dr. H.C.Verma, from chapter 35, "Magnetic Field due to a Current", page 241:
The circulation $\oint\vec B.d\vec l$ of the resultant magnetic field along a closed, plane curve is equal to $\mu_0$ times the total current crossing the area bounded by the closed curve provided the electric field inside the loop remains constant. Thus,
$$\oint\vec B.d\vec l=\mu_0i\tag{35.10}$$
The author says that the magnetic field $\vec B$ on the left-hand side of the above equation is the resultant field due to all the currents either inside the area or outside it. However, the total current $i$ on the right-hand side of the above equation includes only the sum of current through the interior of the closed, plane curve with proper signs.
What is the reason behind the inclusion of magnetic field due to all currents, whether they cross the area or not, and exclusion of currents which do not pass through the area?
To make my question clear, let's consider the following diagram:
My questions are:
Why do we consider the magnetic field $\vec B$ to be due to the currents $i_1,i_2,i_3,i_4$ and $i_5$? Why not just include $i_1,i_2$ and $i_3$?
Why is the total current $i$ is given by $i_1+i_2-i_3$? Why not consider it to be $i_1+i_2-i_3+i_4-i_5$?
Is there any good reason behind these choices or is it only because Ampere's law "is a law"? I'm looking for an intuitive reason similar to that of Gauss law for electrical charges.
Please note: My question is different from Ampere's law and external currents even though they are related. The answers to the linked question didn't clarify my doubt.