Simple answer: A vector is a one-dimensional array.
Imagine we declared something like this:
Real x[1,5,1,1];
Not there are only 5 elements in this thing and they are all contained in the same dimension. So what if we wanted to convert this to a simple vector of 5 elements. We could do this:
Real y[5] = { x[1,i,1,1] for i in 1:5 };
But that gets tedious. The alternative is:
Real y[5] = vector(x);
The compiler looks at this and automatically finds the dimension that has a size>1
and then pulls all the elements out as a vector.
And just to address one point you brought up, this is not valid:
Real z[5] = [1,2,3,4,5];
Because the left hand side is a vector (one dimensional) and the right hand side is an array. Normally, if you wanted to use the right hand side, the left hand side would have to be:
Real z[1,5] = [1,2,3,4,5];
If you want to stuff it into a vector, you need to convert the right hand side from an array to a vector, i.e.,
Real z[5] = vector([1,2,3,4,5]);
Does that help?