Most of the time, your two desires are mutually exclusive. There is only one chance that it will come out perfectly; if the path length is a whole number multiple of the distance.
For example, when you choose Array Along Curve and the Array Along Curve Options box comes up, you can input either option, Number of items or Distance between items. Each category automatically updates the other. Let’s say you choose “Distance between items”, and input 1.93. DON’T HIT ENTER! Look at the “Number of items” box, and make note of the greyed-out number in the box. Again, let’s say that the number is 40. This means that you can place the item 40 times, spaced 1.93 apart, but there may be some extra; not enough for another complete item. If you click on the button in front of the “Number of items” option, and then re-type the number 40. DO NOT HIT ENTER! You will see that the 1.93 will most likely change to a slightly smaller number, say 1.887341. This means that if you want exactly 40 items, and you want them perfectly evenly spaced, your distance will be adjusted to 1.887341. Again, I’m making up the number of items and the distance between items to illustrate the “dilemma”. To quote the Rolling Stones, you can’t always get what you want. When you reconcile the possibilities and decide what will work for you, then you can hit enter. I hope this explains the paradox of number of items vs. distance between items.