I was thinking harder about where my intuitions about this distinction come from, and it came to me that it was from the prior perception of the differences in methods between mathematics and science. So in a way I had been putting the cart before the horse.
This seems to me particularly important in terms of the scoping of the analytic and of logical necessity.
In mathematics, even high school mathematics, the nature of proof is put across. Particularly in geometry, probably the only part of mathematics in which one might be tempted to use observation. This is definitely not on; diagrams we were told, are at best illustrative. A proof may not depend upon any feature of a diagram, which might prove accidental.
On the other hand, in physics meditation is not in order, observation is what it takes.
If we consider the reason for this de-facto methodological differentiation we do not have far to look. It lies in the respective subject matters of mathematics and physics. In the latter case we are interested in real world phenomena. In the former we address ethereal abstractions which are not of this world.
The brute methodological disparity motivates a classification of propositions as either a priori or a posteriori, depending on whether or not observations are thought essential for determining truth.
The explanation lies in a difference of content in the proposition. Mathematical propositions say nothing about the real world. Once the meaning of a sentence is discovered (and this may be a matter for observation) no further information from the material world is needed to determine whether the proposition is true. Scientific propositions by contrast are called synthetic. The say something substantive about the world.
One further step may be taken along this road. If the truth of a proposition can be determined without observing the world, then our grounds for belief in the proposition will hold good in any world. Prior to observation all worlds are, for all we know, identical. So an a priori proposition, if true in any world, must be true in them all. For this reason such propositions are considered necessary propositions, since they could not be other than true. Necessity in this sense may sometimes be called logical necessity to distinguish from propositions which are necessitated by the laws of physics.
Propositions which are not necessary are called contingent, and are possibly false.
We have now arrived at logical necessity by a route which makes it appear that the paradigmatic cases of necessary propositions are those of mathematics.