Group by and Memory group by

What is difference between group by and memory group by ? and what if we don’t define group field then what will happens, still it works?

Group By works on pre-sorted data and is suited for large datasets, while Memory Group By aggregates unsorted data in memory, offering faster performance for smaller datasets with higher memory usage.

If no group field is defined, both steps treat all rows as one group and return a single aggregated result.