I'm pretty sure it was decided by the government of the day, following a parliamentary commission.
Geography was quite vague, because the grouping was a merger of commercial companies with overlapping networks.
The LMS reached Goole, Southend and Swansea (and into NI), while the LNER reached Wrexham and Birkenhead.
Some effort was made to make the new companies of a similar size, and for instance the Cambrian went to the GWR because the LMS was already considered "too big".
Competition was also part of the equation, which prevented the Midland and GC ending up in the same group.
It also meant Scotland was still divided between two big companies, though the smaller ones were absorbed into both LMS and LNER.
Joint lines were sometimes tidied up and merged, others not.
So the CLC continued right up to nationalisation, split 2/3 to LNER, 1/3 to the LMS, and there were several other sizeable joint operations between the Big 4.
There was some rationalisation of services within the new groups, to reduce duplication.
The Forth Bridge became 25% LMS because of the Midland 1/4 share, the other 3/4 belonging to companies which merged into the LNER (GN, NE, NB).
Much of the 1923 structure still applied well into BR (outside Scotland), until the Regional boundaries were finally made geographical in 1963 (though they have continued to change since).