"What is her name?"
The 'の' is part of 'Her'.
The particle supports the meaning of 'かのじょ'. 'かのじょ' alone can not be 'her'. 'Her' is not '彼女/かのじょ' but ’彼女/かのじょ together の’.
'I' is 'わたしは/わたしが' . 'My' is 'わたしの'.
'She' Is 'かのじょは/かのじょが'. 'Her' is 'かのじょの'.
(In here. because 'her' has other meaning)
This 'の' is resemble 'of' or 'apostrophe s'.
'her name' is 'かのじょのなまえ'.
'name of Tanaka' is 'たなかのなまえ'.
'Tanaka's name' is 'たなかのなまえ'
In this case, かのじょの名前 needs to be grouped together in this particular order because it means 'her name'. の is used here to show possession and functions like 'of' or apostrophe s in English. It's a bit easier to understand if you replace かのじょ with a noun, for example: 先生の名前 means 'teacher's name' or 'name of teacher'. If you flip around: 名前の先生 would mean 'name's teacher' or 'teacher of name' which doesn't make sense. Similarly, 名前のかのじょ ('name's she' or 'she of name') doesn't make sense so you can't just change the order however you like.
名前はかのじょの何ですか would translate into something like 'her what is name?'
Because this way you don't connect the name with the girl ("名前" could be the name of anyone). You don't make your listener/reader understand that the center (and subject) of your sentence is the name. Instead you shift the girl (かのじょ) at the center making her the subject, while the word "名前" has no clear function in the sentence