Going by the article in wikipedia Dynamic Array
It automatically allocates memory in geometrical progression amounts as the last empty memory cell is filled up and then copies entire data to the new array. What happens when one removes elements in quantity larger than the amount by which it was increased? Does it automatically deallocate memory too? Or does it leave it as it is?
For example in the image on the top right of the above wikipedia link,

after the last step 2|7|1|3|8|4| one removes all the elements except 2. What happens then? Does it allocate memory of smaller size and copy the entire contents to the new one?
Side question: How or what decides what would be initial amount of memory allocated to a dynamic array?
The article you cite replies your question:
“Many dynamic arrays also deallocate some of the underlying storage if its size drops below a certain threshold, […]”
It’s really worth reading 😉
For the cases where you know in advance that you will need a specific size, some implementations provide a specific method (“reserve()”, in the C++ Standard Library).