Seems to me that the "meat" of your question is not about Bernoulli's principle, but rather a related concept called "conservation of mass" . I'll address that first, and get to Bernoulli's principle later.
Conservation of mass
The idea you are looking for is Conservation of Mass. If you assume the fluid doesn't have any "gaps" or spaces (and real fluids don't) and isn't compressible (which is true for liquids and often close enough for gasses) then the flow rate must be the same everywhere in the pipe.
Consider some section of the pipe, for instance the part of the pipe between cross-sectional areas A1 and A2 in the diagram above. Fluid flows into it at some rate, say x liters/minute. It has to go somewhere, and if it can't compress and you don't allow empty spaces then the only place for it to go is out the other end. For every fluid molecule that passes through A1, one must exit at A2, otherwise the fluid would pile up in that section of the pipe. So, fluid must exit the segment at the same rate of x liters/minute. Since we chose our segment endpoints arbitrarily, the rate of flow must be the same everywhere.
Now, if the pipe gets thinner, say half the diameter, the flow has to speed up to twice the speed to maintain the constant x liters/minute flow.
Bernoulli's principle then says that the pressure in this narrow section of pipe decreases, but I don't think the main gist of your post was about Bernoulli's principle. But since that's the title of the post, here goes:
To address "Why does Bernoulli's principle work?", there's two ways to look at it:
- conservation of energy
- acceleration due to pressure differences
conservation of energy
Bernoulli's equation is often derived using conservation of energy. We've seen from conservation of mass that the fluid molecules in the pipe above have to speed up when they pass through the narrow part of the pipe. That means their kinetic energy has to increase since KE = mv^2 /2. Where does this energy come from? It comes from a decrease in pressure.
Usually, one thinks of pressure in terms of force per unit area (i.e. pounds per square inch) but pressure can also be thought of as energy per unit volume. So, less pressure means less energy. Essentially, Bernoulli's equation expresses the trade-off between kinetic energy of the moving fluid and the "potential" energy contained in the pressure. (often the equation includes a term for gravitational potential energy too.)
The nice thing about deriving Bernoulli's principle from conservation of energy is that the derivation can be done using only algebra - no calculus needed. That's why you see this treatment in high school texts. The thing is, the concept of energy wasn't around in 1738 when Bernoulli derived his formula. The term "energy" was first used by Thomas Young in 1807, and it would be another thirty years or so before the law of conservation of energy was clearly established. So, Bernoulli was about a century too early to use conservation of energy.
acceleration due to pressure differences
Bernoulli actually derived the equation from first principles (i.e. Newton's laws of motion) and if you examine this derivation it becomes clearer why Bernoulli's principle works. Basically, you look at a small volume of fluid and the forces on that volume. If the pressure is decreasing along the direction of travel then there is more pressure behind than in front. This makes a net force on the volume, and according to F=ma the fluid accelerates. On the other hand, if the pressure is increasing, then there's more pressure in front than behind and the fluid slows down.
Bernoulli simply took the intuitive idea of "more pressure behind than in front means the fluid will accelerate", quantified the pressure and speed using Newton's second law (F= ma) to get an intermediate equation, and then and used calculus to integrate that equation to get the equation we're familiar with today.
Thinking about Bernoulli's principle this way makes it intuitively clear why it happens - of course the fluid will accelerate if there's more pressure behind than in front. Unfortunately, to derive the equation this way means you need to know calculus so it's rarely taught this way in high school science classes. That's a shame, because the physics is fairly simple if you think about it this way.
Many students struggle to find an intuitive reason why faster moving fluid has lower pressure - why should the pressure drop just because it's moving faster? And if you express Bernoulli's principle as "faster moving fluid has lower pressure" it's mysterious why this should be so.
But if you think of it as "pressure differences cause the fluid to accelerate and gain speed" it's obvious why it works. From an intuitive perspective, the usual statement of Bernoulli's principle ("faster moving air causes lower pressure") gets it exactly backwards - the change in speed is a ''result'' of pressure differences, not the ''cause''. Or as Klaus Weltner put it in the American Journal of Physics
Textbooks stating that the higher streaming velocity is the reason
for the low pressure are wrong. It is the other way round. The
low pressure is the reason for the higher velocity of the streaming
-from "A comparison of explanations of the aerodynamic lifting force" Klaus Weltner Am. J. Phys. 55, 50 (1987);