How to fit an object generated by the Array modifier into a frame precisely?
You can just calculate it. To make life easier let's enable MeasureIt add-on in the User Preferences(ctrl+alt+u) in the add-ons tab:



So let's say we have an array of 23 elements. Let's enter 1 as the Relative Offset to get an array without any gaps:



Then we need to measure the remaining gap so let's enter edit mode of the frame object and grab one corner vertex and duplicate it (Shift+d) and snap it to the end of the array object. This way the distance can be measured with MeasureIt easily. Note that you can choose units of MeasureIt in the Side Panel(n).



Now we know what distance we need to fill. So we want every array element to have a gap after it except the last one, so that is 23-1=22 gaps. We wll need to divide the distance into 22 parts, so let's enter the distance in the Constant Offset field and divide it by 22 in the field itself and hit enter and that is it.