In brief
The flattening has a set depth and returns a new array.
Useful to know
flat() collects elements from nested arrays to a selected depth. By default it is one level : [1, [2, [3]]].flat() gives [1, 2, [3]]. With flat(2), the result is [1, 2, 3]. [1]
Select the depth according to the data structure. Indiscriminate removal of all levels can delete useful grouping, for example rows and columns. The new external array does not mean deep copying of every object inside; the method decides the list structure, not the independence of all data.
Sources
For further detail and to check the information: