Array vs dynamic

as array is stored in static allocation so why can we make an array with a size of n which is variable taken during run time
eg int a[n];

it can only be done after n is input, so it replaces n by that number and then allocates that much amount of static memory